aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorandrew-rykov <arykov@ydb.tech>2023-10-17 01:38:56 +0300
committerandrew-rykov <arykov@ydb.tech>2023-10-17 02:08:02 +0300
commita2b4b55fa00ab6fb08251f0c723ca88a1f2d165e (patch)
treedf9e57196707f0d8a1ee20a9fdfe998181169d9c
parentbea9c250522d1595e1cdc48c685299053ff2360a (diff)
downloadydb-a2b4b55fa00ab6fb08251f0c723ca88a1f2d165e.tar.gz
KIKIMR-16043 revert clock skew
-rw-r--r--ydb/core/health_check/health_check.cpp57
-rw-r--r--ydb/core/protos/node_whiteboard.proto2
-rw-r--r--ydb/core/tablet/node_whiteboard.cpp24
3 files changed, 0 insertions, 83 deletions
diff --git a/ydb/core/health_check/health_check.cpp b/ydb/core/health_check/health_check.cpp
index 524c33c833..c94c29907f 100644
--- a/ydb/core/health_check/health_check.cpp
+++ b/ydb/core/health_check/health_check.cpp
@@ -139,7 +139,6 @@ public:
TabletState,
SystemTabletState,
OverloadState,
- SyncState,
};
struct TTenantInfo {
@@ -449,7 +448,6 @@ public:
THashMap<TNodeId, THolder<NNodeWhiteboard::TEvWhiteboard::TEvSystemStateResponse>> NodeSystemState;
THashMap<TNodeId, const NKikimrWhiteboard::TSystemStateInfo*> MergedNodeSystemState;
- THashSet<TNodeId> UsedClockSkewNodes;
std::unordered_map<TString, const NKikimrBlobStorage::TBaseConfig::TPDisk*> BSConfigPDisks;
std::unordered_map<TString, const NKikimrBlobStorage::TBaseConfig::TVSlot*> BSConfigVSlots;
@@ -2052,60 +2050,6 @@ public:
}
}
- bool IsRequiredClockSkewIssue(const NKikimrWhiteboard::TSystemStateInfo& nodeSystemState) {
- if (!nodeSystemState.has_clockskewpeerid()) {
- return true;
- }
- const ui32 peerId = nodeSystemState.clockskewpeerid();
- auto itPeerState = MergedNodeSystemState.find(peerId);
- if (itPeerState == MergedNodeSystemState.end() || UsedClockSkewNodes.contains(peerId)) {
- return false;
- }
- const NKikimrWhiteboard::TSystemStateInfo& peerState(*itPeerState->second);
- if (!peerState.has_clockskewpeerid()) {
- return true;
- }
- const ui32 nextPeerId = peerState.clockskewpeerid();
- if (nextPeerId != nodeSystemState.nodeid() && !UsedClockSkewNodes.contains(nextPeerId)) {
- return false;
- }
- return true;
- }
-
- void FillClockSkewResult(TNodeId nodeId, TSelfCheckContext context) {
- FillNodeInfo(nodeId, context.Location.mutable_node());
- auto itNodeSystemState = MergedNodeSystemState.find(nodeId);
- if (itNodeSystemState != MergedNodeSystemState.end()) {
- const NKikimrWhiteboard::TSystemStateInfo& nodeSystemState(*itNodeSystemState->second);
- if (IsRequiredClockSkewIssue(nodeSystemState)) {
- UsedClockSkewNodes.emplace(nodeId);
- if (nodeSystemState.has_clockskewpeerid()) {
- const ui32 peerId = nodeSystemState.clockskewpeerid();
- UsedClockSkewNodes.emplace(peerId);
- FillNodeInfo(peerId, context.Location.mutable_peer());
- }
- if (nodeSystemState.clockskewmicrosec() > 25000) {
- context.ReportStatus(Ydb::Monitoring::StatusFlag::RED, "Time difference is more than 25 ms", ETags::NodeState);
- } else if (nodeSystemState.clockskewmicrosec() > 5000) {
- context.ReportStatus(Ydb::Monitoring::StatusFlag::YELLOW, "Time difference is more than 5 ms", ETags::NodeState);
- } else {
- context.ReportStatus(Ydb::Monitoring::StatusFlag::GREEN);
- }
- }
- }
- }
-
- void FillNodesSyncResult(TOverallStateContext& context) {
- TSelfCheckResult syncContext;
- syncContext.Type = "NODES_SYNC";
- for (TNodeId nodeId : NodeIds) {
- FillClockSkewResult(nodeId, {&syncContext, "TIME"});
- }
- syncContext.ReportWithMaxChildStatus("Time difference exceeded", ETags::SyncState, {ETags::NodeState});
- context.UpdateMaxStatus(syncContext.GetOverallStatus());
- context.AddIssues(syncContext.IssueRecords);
- }
-
void FillResult(TOverallStateContext context) {
if (IsSpecificDatabaseFilter()) {
FillDatabaseResult(context, FilterDatabase, DatabaseState[FilterDatabase]);
@@ -2114,7 +2058,6 @@ public:
FillDatabaseResult(context, path, state);
}
}
- FillNodesSyncResult(context);
if (DatabaseState.empty()) {
Ydb::Monitoring::DatabaseStatus& databaseStatus(*context.Result->add_database_status());
TSelfCheckResult tabletContext;
diff --git a/ydb/core/protos/node_whiteboard.proto b/ydb/core/protos/node_whiteboard.proto
index 5fef8f2243..d168a64f59 100644
--- a/ydb/core/protos/node_whiteboard.proto
+++ b/ydb/core/protos/node_whiteboard.proto
@@ -306,8 +306,6 @@ message TSystemStateInfo {
optional uint64 MemoryUsedInAlloc = 29;
optional double MaxDiskUsage = 30;
optional NActorsInterconnect.TNodeLocation Location = 31;
- optional uint64 ClockSkewMicrosec = 32;
- optional uint64 ClockSkewPeerId = 33;
optional uint64 DisconnectTime = 34;
}
diff --git a/ydb/core/tablet/node_whiteboard.cpp b/ydb/core/tablet/node_whiteboard.cpp
index 5eb1900169..19ad017b12 100644
--- a/ydb/core/tablet/node_whiteboard.cpp
+++ b/ydb/core/tablet/node_whiteboard.cpp
@@ -641,30 +641,6 @@ protected:
SystemStateInfo.SetSystemState(eFlag);
SystemStateInfo.SetChangeTime(ctx.Now().MilliSeconds());
}
-
- const TIntrusivePtr<::NMonitoring::TDynamicCounters> &counters = AppData(ctx)->Counters;
- TIntrusivePtr<::NMonitoring::TDynamicCounters> interconnectCounters = GetServiceCounters(counters, "interconnect");
- ui64 clockSkew = 0;
- ui32 peerId = 0;
- interconnectCounters->EnumerateSubgroups([&interconnectCounters, &clockSkew, &peerId](const TString &name, const TString &value) -> void {
- if (name == "peer") {
- TIntrusivePtr<::NMonitoring::TDynamicCounters> peerCounters = interconnectCounters->GetSubgroup(name, value);
- ::NMonitoring::TDynamicCounters::TCounterPtr connectedCounter = peerCounters->GetCounter("ClockSkewMicrosec");
- ui64 skew = abs(connectedCounter->Val());
- if (skew > clockSkew) {
- clockSkew = skew;
- TStringBuf tokenBuf(value);
- TString tok(tokenBuf.NextTok(':'));
- if (tok) {
- peerId = std::stoi(tok);
- }
- }
- }
- });
- if (clockSkew > 0) {
- SystemStateInfo.SetClockSkewMicrosec(clockSkew);
- SystemStateInfo.SetClockSkewPeerId(peerId);
- }
}
static void CopyTabletStateInfo(