-
Notifications
You must be signed in to change notification settings - Fork 600
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
schemeshard: remove schemeshard_utils.h from common dependencies (#12012
) Remove `schemeshard_utils.h` from `schemeshard_impl.h` includes. Move `TShardDeleter` and `TSelfPinger` out of `schemeshard_utils.*`. This is part of "improve schemeshard operation build-time" effort (#10633).
- Loading branch information
Showing
43 changed files
with
402 additions
and
302 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
ydb/core/tx/schemeshard/schemeshard__operation_consistent_copy_tables.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 2 additions & 3 deletions
5
ydb/core/tx/schemeshard/schemeshard__operation_create_build_index.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
#include "schemeshard_self_pinger.h" | ||
#include "schemeshard.h" // for TEvMeasureSelfResponseTime and TEvWakeupToMeasureSelfResponseTime | ||
|
||
#include <ydb/core/protos/counters_schemeshard.pb.h> | ||
|
||
namespace NKikimr::NSchemeShard { | ||
|
||
void TSelfPinger::Handle(TEvSchemeShard::TEvMeasureSelfResponseTime::TPtr &ev, const NActors::TActorContext &ctx) { | ||
Y_UNUSED(ev); | ||
TInstant now = AppData(ctx)->TimeProvider->Now(); | ||
TDuration responseTime = now - SelfPingSentTime; | ||
LastResponseTime = responseTime; | ||
TabletCounters->Simple()[COUNTER_RESPONSE_TIME_USEC].Set(LastResponseTime.MicroSeconds()); | ||
if (responseTime.MilliSeconds() > 1000) { | ||
LOG_WARN_S(ctx, NKikimrServices::FLAT_TX_SCHEMESHARD, | ||
"Schemeshard " << TabletId << " response time is " << responseTime.MilliSeconds() << " msec"); | ||
} | ||
SelfPingInFlight = false; | ||
if (responseTime > SELF_PING_INTERVAL) { | ||
DoSelfPing(ctx); | ||
} else { | ||
ScheduleSelfPingWakeup(ctx); | ||
} | ||
} | ||
|
||
void TSelfPinger::Handle(TEvSchemeShard::TEvWakeupToMeasureSelfResponseTime::TPtr &ev, const NActors::TActorContext &ctx) { | ||
Y_UNUSED(ev); | ||
SelfPingWakeupScheduled = false; | ||
DoSelfPing(ctx); | ||
} | ||
|
||
void TSelfPinger::OnAnyEvent(const NActors::TActorContext &ctx) { | ||
TInstant now = AppData(ctx)->TimeProvider->Now(); | ||
if (SelfPingInFlight) { | ||
TDuration responseTime = now - SelfPingSentTime; | ||
// Increase measured response time is ping is taking longer than then the previous one | ||
LastResponseTime = Max(LastResponseTime, responseTime); | ||
TabletCounters->Simple()[COUNTER_RESPONSE_TIME_USEC].Set(LastResponseTime.MicroSeconds()); | ||
} else if ((now - SelfPingWakeupScheduledTime) > SELF_PING_INTERVAL) { | ||
DoSelfPing(ctx); | ||
} | ||
} | ||
|
||
void TSelfPinger::DoSelfPing(const NActors::TActorContext &ctx) { | ||
if (SelfPingInFlight) | ||
return; | ||
|
||
ctx.Send(ctx.SelfID, new TEvSchemeShard::TEvMeasureSelfResponseTime); | ||
SelfPingSentTime = AppData(ctx)->TimeProvider->Now(); | ||
SelfPingInFlight = true; | ||
} | ||
|
||
void TSelfPinger::ScheduleSelfPingWakeup(const NActors::TActorContext &ctx) { | ||
if (SelfPingWakeupScheduled) | ||
return; | ||
|
||
ctx.Schedule(SELF_PING_INTERVAL, new TEvSchemeShard::TEvWakeupToMeasureSelfResponseTime); | ||
SelfPingWakeupScheduled = true; | ||
SelfPingWakeupScheduledTime = AppData(ctx)->TimeProvider->Now(); | ||
} | ||
|
||
} // namespace NKikimr::NSchemeShard |
Oops, something went wrong.