Skip to content

Commit eb37c05

Browse files
authored
Merge branch 'stable-25-1-3' into changelog/stable-25-1-3-2025-08-10
2 parents 01ac8ad + cbf6107 commit eb37c05

File tree

5 files changed

+177
-44
lines changed

5 files changed

+177
-44
lines changed

.github/config/muted_ya.txt

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ ydb/core/blobstorage/ut_vdisk TBsVDiskManyPutGet.ManyPutRangeGetCompactionIndexO
99
ydb/core/blobstorage/ut_vdisk [*/*] chunk chunk
1010
ydb/core/client/ut TObjectStorageListingTest.TestSkipShards
1111
ydb/core/cms/ut_sentinel_unstable TSentinelUnstableTests.BSControllerCantChangeStatus
12+
ydb/core/fq/libs/row_dispatcher/format_handler/ut TestFormatHandler.ClientErrorWithEmptyFilter
1213
ydb/core/fq/libs/row_dispatcher/format_handler/ut TestFormatHandler.ManyRawClients
1314
ydb/core/fq/libs/row_dispatcher/ut sole chunk chunk
1415
ydb/core/http_proxy/ut/inside_ydb_ut TestKinesisHttpProxy.ErroneousRequestGetRecords
15-
ydb/core/kafka_proxy/ut ProduceActor.OnProduceWithoutTransactionalId_shouldNotKillOldWriter
1616
ydb/core/keyvalue/ut_trace TKeyValueTracingTest.ReadHuge
1717
ydb/core/keyvalue/ut_trace TKeyValueTracingTest.ReadSmall
1818
ydb/core/keyvalue/ut_trace TKeyValueTracingTest.WriteHuge
@@ -24,22 +24,28 @@ ydb/core/kqp/ut/join KqpIndexLookupJoin.LeftJoinRightNullFilter+StreamLookup
2424
ydb/core/kqp/ut/join KqpIndexLookupJoin.LeftJoinRightNullFilter-StreamLookup
2525
ydb/core/kqp/ut/olap KqpOlapAggregations.BlockGenericWithDistinct
2626
ydb/core/kqp/ut/olap KqpOlapJson.BloomCategoryIndexesVariants
27+
ydb/core/kqp/ut/olap KqpOlapJson.BloomMixIndexesVariants
28+
ydb/core/kqp/ut/olap KqpOlapJson.BloomNGrammIndexesVariants
2729
ydb/core/kqp/ut/olap KqpOlapJson.CompactionVariants
2830
ydb/core/kqp/ut/olap KqpOlapJson.DoubleFilterReduceScopeVariants
2931
ydb/core/kqp/ut/olap KqpOlapJson.DoubleFilterReduceScopeWithPredicateVariants
32+
ydb/core/kqp/ut/olap KqpOlapJson.DoubleFilterReduceScopeWithPredicateVariantsWithSeparatedColumnAtFirst
3033
ydb/core/kqp/ut/olap KqpOlapJson.DoubleFilterVariants
3134
ydb/core/kqp/ut/olap KqpOlapJson.DuplicationCompactionVariants
3235
ydb/core/kqp/ut/olap KqpOlapJson.EmptyVariants
3336
ydb/core/kqp/ut/olap KqpOlapJson.FilterVariants
3437
ydb/core/kqp/ut/olap KqpOlapJson.FilterVariantsCount
3538
ydb/core/kqp/ut/olap KqpOlapJson.QuotedFilterVariants
3639
ydb/core/kqp/ut/olap KqpOlapJson.RestoreFullJsonVariants
40+
ydb/core/kqp/ut/olap KqpOlapJson.RestoreJsonArrayVariants
3741
ydb/core/kqp/ut/olap KqpOlapJson.SimpleExistsVariants
3842
ydb/core/kqp/ut/olap KqpOlapJson.SwitchAccessorCompactionVariants
43+
ydb/core/kqp/ut/olap KqpOlapOptimizer.SpecialSliceToOneLayer
3944
ydb/core/kqp/ut/olap KqpOlapWrite.TierDraftsGCWithRestart
4045
ydb/core/kqp/ut/olap [*/*] chunk chunk
4146
ydb/core/kqp/ut/query KqpAnalyze.AnalyzeTable+ColumnStore
4247
ydb/core/kqp/ut/query KqpAnalyze.AnalyzeTable-ColumnStore
48+
ydb/core/kqp/ut/query KqpStats.SysViewClientLost
4349
ydb/core/kqp/ut/scheme KqpOlapScheme.TenThousandColumns
4450
ydb/core/kqp/ut/tx KqpSnapshotIsolation.TConflictReadWriteOlap
4551
ydb/core/kqp/ut/tx KqpSnapshotIsolation.TConflictReadWriteOltp
@@ -53,23 +59,33 @@ ydb/core/kqp/ut/tx KqpSnapshotIsolation.TReadOnlyOltpNoSink
5359
ydb/core/kqp/ut/tx KqpSnapshotIsolation.TSimpleOlap
5460
ydb/core/kqp/ut/tx KqpSnapshotIsolation.TSimpleOltp
5561
ydb/core/kqp/ut/tx KqpSnapshotIsolation.TSimpleOltpNoSink
62+
ydb/core/mind/hive/ut THiveTest.TestCheckSubHiveMigrationWithReboots
63+
ydb/core/mind/hive/ut THiveTest.TestCreateSubHiveCreateManyTabletsWithReboots
64+
ydb/core/mind/hive/ut [*/*] chunk chunk
65+
ydb/core/persqueue/ut/ut_with_sdk TopicAutoscaling.PartitionSplit_PreferedPartition_BeforeAutoscaleAwareSDK
5666
ydb/core/quoter/ut QuoterWithKesusTest.PrefetchCoefficient
5767
ydb/core/statistics/aggregator/ut AnalyzeColumnshard.AnalyzeRebootColumnShard
5868
ydb/core/tablet_flat/ut TSharedPageCache.ClockPro
5969
ydb/core/tablet_flat/ut TSharedPageCache.Compaction_FlatIndex
70+
ydb/core/tablet_flat/ut TSharedPageCache.ThreeLeveledLRU
6071
ydb/core/tx/conveyor_composite/ut CompositeConveyorTests.TestUniformDistribution
6172
ydb/core/tx/datashard/ut_incremental_backup IncrementalBackup.ComplexRestoreBackupCollection+WithIncremental
6273
ydb/core/tx/tiering/ut ColumnShardTiers.TTLUsage
6374
ydb/core/viewer/tests test.py.test_transfer_describe
6475
ydb/library/actors/http/ut sole chunk chunk
6576
ydb/library/actors/interconnect/ut_huge_cluster HugeCluster.AllToAll
6677
ydb/library/actors/interconnect/ut_huge_cluster sole chunk chunk
78+
ydb/library/yql/dq/actors/spilling/ut DqSpillingFileTests.ThreadPoolQueueOverflow
6779
ydb/public/sdk/cpp/src/client/topic/ut TxUsage.Sinks_Olap_WriteToTopicAndTable_4_Query
80+
ydb/public/sdk/cpp/src/client/topic/ut TxUsage.Sinks_Oltp_WriteToTopicAndTable_6_Query
6881
ydb/public/sdk/cpp/src/client/topic/ut TxUsage.Sinks_Oltp_WriteToTopicAndTable_6_Table
6982
ydb/services/ydb/sdk_sessions_pool_ut YdbSdkSessionsPool.StressTestSync1
83+
ydb/services/ydb/sdk_sessions_pool_ut YdbSdkSessionsPool.StressTestSync10
84+
ydb/services/ydb/sdk_sessions_ut YdbSdkSessions.TestSdkFreeSessionAfterBadSessionQueryService
7085
ydb/services/ydb/sdk_sessions_ut YdbSdkSessions.TestSdkFreeSessionAfterBadSessionQueryServiceStreamCall
7186
ydb/services/ydb/sdk_sessions_ut [*/*] chunk chunk
7287
ydb/services/ydb/ut YdbLogStore.AlterLogTable
88+
ydb/tests/fq/http_api test_http_api.py.TestHttpApi.test_simple_analytics_query
7389
ydb/tests/fq/mem_alloc test_alloc_default.py.TestAlloc.test_alloc_and_free[kikimr0]
7490
ydb/tests/fq/mem_alloc test_scheduling.py.TestSchedule.test_skip_busy[kikimr0]
7591
ydb/tests/fq/yds test_2_selects_limit.py.TestSelectLimit.test_select_same[v1]

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,12 @@
1212
* 20633:Fix for Arrow arena when allocating zero-sized region. [#20633](https://github.com/ydb-platform/ydb/pull/20633) ([Ivan](https://github.com/abyss7))
1313
* 20997:Fix for GROUP BY emitting multiple NULL keys when block processing is enabled. [#20997](https://github.com/ydb-platform/ydb/pull/20997) ([Pavel Zuev](https://github.com/pzuev))
1414
* 21356:Added gettxtype in txwrite. [#21356](https://github.com/ydb-platform/ydb/pull/21356) ([r314-git](https://github.com/r314-git))
15+
* 21918:Support in asynchronous replication new kind of change record — `reset` record (in addition to `update` & `erase` records). [#21918](https://github.com/ydb-platform/ydb/pull/21918) ([Ilnaz Nizametdinov](https://github.com/CyberROFL))
16+
* 21836:Fixed an [issue](https://github.com/ydb-platform/ydb/issues/21814) where a replication instance with an unspecified `COMMIT_INTERVAL` option caused the process to crash. [#21836](https://github.com/ydb-platform/ydb/pull/21836) ([Ilnaz Nizametdinov](https://github.com/CyberROFL))
17+
* 21652:Fixed rare errors when reading using the pqv0 protocol from a topic during partition balancing. [#21652](https://github.com/ydb-platform/ydb/pull/21652) ([Nikolay Shestakov](https://github.com/nshestakov))
1518
* 22520:Fix default values for Kafka protocol [#22520](https://github.com/ydb-platform/ydb/pull/22520) ([qyryq](https://github.com/qyryq))
1619
* 22455:Fix issue where dedicated database deletion may leave database system tablets improperly cleaned. [#22455](https://github.com/ydb-platform/ydb/pull/22455) ([ijon](https://github.com/ijon))
17-
* 22203:ensure tablets are launched after nodes stop being overloaded, fixes https://github.com/ydb-platform/ydb/issues/22030 [#22203](https://github.com/ydb-platform/ydb/pull/22203) ([vporyadke](https://github.com/vporyadke))
20+
* 22203:Fixed an [issue](https://github.com/ydb-platform/ydb/issues/22030) that caused tablets to hang when nodes experienced critical memory shortage. Now tablets will automatically start as soon as any of the nodes frees up sufficient resources. [#22203](https://github.com/ydb-platform/ydb/pull/22203) ([vporyadke](https://github.com/vporyadke))
1821
* 21106:Cherry-pick from main fix for KIKIMR-23489 [#21106](https://github.com/ydb-platform/ydb/pull/21106) ([Denis Khalikov](https://github.com/denis0x0D))
1922

2023
### YDB UI

ydb/core/health_check/health_check.cpp

Lines changed: 80 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ struct std::hash<NKikimrBlobStorage::TVSlotId> {
5959

6060
#define BLOG_CRIT(stream) LOG_CRIT_S(*TlsActivationContext, NKikimrServices::HEALTH, stream)
6161
#define BLOG_D(stream) LOG_DEBUG_S(*TlsActivationContext, NKikimrServices::HEALTH, stream)
62+
#define BLOG_TRACE(stream) LOG_TRACE_S(*TlsActivationContext, NKikimrServices::HEALTH, stream)
6263

6364
namespace NKikimr::NHealthCheck {
6465

@@ -474,22 +475,23 @@ class TSelfCheckRequest : public TActorBootstrapped<TSelfCheckRequest> {
474475
TRequestResponse& operator =(const TRequestResponse&) = delete;
475476
TRequestResponse& operator =(TRequestResponse&&) = default;
476477

477-
void Set(std::unique_ptr<T>&& response) {
478+
bool Set(std::unique_ptr<T>&& response) {
479+
if (IsDone()) {
480+
return false;
481+
}
478482
constexpr bool hasErrorCheck = requires(const std::unique_ptr<T>& r) {TSelfCheckRequest::IsSuccess(r);};
479483
if constexpr (hasErrorCheck) {
480484
if (!TSelfCheckRequest::IsSuccess(response)) {
481-
Error(TSelfCheckRequest::GetError(response));
482-
return;
485+
return Error(TSelfCheckRequest::GetError(response));
483486
}
484487
}
485-
if (!IsDone()) {
486-
Span.EndOk();
487-
}
488+
Span.EndOk();
488489
Response = std::move(response);
490+
return true;
489491
}
490492

491-
void Set(TAutoPtr<TEventHandle<T>>&& response) {
492-
Set(std::unique_ptr<T>(response->Release().Release()));
493+
bool Set(TAutoPtr<TEventHandle<T>>&& response) {
494+
return Set(std::unique_ptr<T>(response->Release().Release()));
493495
}
494496

495497
bool Error(const TString& error) {
@@ -892,6 +894,7 @@ class TSelfCheckRequest : public TActorBootstrapped<TSelfCheckRequest> {
892894

893895
void RequestDone(const char* name) {
894896
--Requests;
897+
BLOG_TRACE("RequestDone(" << name << "): remaining " << Requests);
895898
if (Requests == 0) {
896899
ReplyAndPassAway();
897900
}
@@ -1089,7 +1092,9 @@ class TSelfCheckRequest : public TActorBootstrapped<TSelfCheckRequest> {
10891092
}
10901093

10911094
void Handle(TEvStateStorage::TEvBoardInfo::TPtr& ev) {
1092-
DatabaseBoardInfo->Set(std::move(ev));
1095+
if (!DatabaseBoardInfo->Set(std::move(ev))) {
1096+
return;
1097+
}
10931098
if (DatabaseBoardInfo->IsOk()) {
10941099
TDatabaseState& database = DatabaseState[FilterDatabase];
10951100
for (const auto& entry : DatabaseBoardInfo->Get()->InfoEntries) {
@@ -1107,18 +1112,34 @@ class TSelfCheckRequest : public TActorBootstrapped<TSelfCheckRequest> {
11071112
auto eventId = ev->Get()->EventId;
11081113
auto nodeId = ev->Get()->NodeId;
11091114
switch (eventId) {
1110-
case TEvWhiteboard::EvSystemStateRequest:
1111-
NodeSystemState[nodeId] = RequestNodeWhiteboard<TEvWhiteboard::TEvSystemStateRequest>(nodeId, {-1});
1115+
case TEvWhiteboard::EvSystemStateRequest: {
1116+
auto& request = NodeSystemState[nodeId];
1117+
if (!request.IsOk()) {
1118+
request = RequestNodeWhiteboard<TEvWhiteboard::TEvSystemStateRequest>(nodeId, {-1});
1119+
}
11121120
break;
1113-
case TEvWhiteboard::EvVDiskStateRequest:
1114-
NodeVDiskState[nodeId] = RequestNodeWhiteboard<TEvWhiteboard::TEvVDiskStateRequest>(nodeId);
1121+
}
1122+
case TEvWhiteboard::EvVDiskStateRequest: {
1123+
auto& request = NodeVDiskState[nodeId];
1124+
if (!request.IsOk()) {
1125+
request = RequestNodeWhiteboard<TEvWhiteboard::TEvVDiskStateRequest>(nodeId);
1126+
}
11151127
break;
1116-
case TEvWhiteboard::EvPDiskStateRequest:
1117-
NodePDiskState[nodeId] = RequestNodeWhiteboard<TEvWhiteboard::TEvPDiskStateRequest>(nodeId);
1128+
}
1129+
case TEvWhiteboard::EvPDiskStateRequest: {
1130+
auto& request = NodePDiskState[nodeId];
1131+
if (!request.IsOk()) {
1132+
request = RequestNodeWhiteboard<TEvWhiteboard::TEvPDiskStateRequest>(nodeId);
1133+
}
11181134
break;
1119-
case TEvWhiteboard::EvBSGroupStateRequest:
1120-
NodeBSGroupState[nodeId] = RequestNodeWhiteboard<TEvWhiteboard::TEvBSGroupStateRequest>(nodeId);
1135+
}
1136+
case TEvWhiteboard::EvBSGroupStateRequest: {
1137+
auto& request = NodeBSGroupState[nodeId];
1138+
if (!request.IsOk()) {
1139+
request = RequestNodeWhiteboard<TEvWhiteboard::TEvBSGroupStateRequest>(nodeId);
1140+
}
11211141
break;
1142+
}
11221143
default:
11231144
RequestDone("unsupported event scheduled");
11241145
break;
@@ -1310,7 +1331,9 @@ class TSelfCheckRequest : public TActorBootstrapped<TSelfCheckRequest> {
13101331

13111332
void Handle(TEvInterconnect::TEvNodesInfo::TPtr& ev) {
13121333
bool needComputeFromStaticNodes = !IsSpecificDatabaseFilter();
1313-
NodesInfo->Set(std::move(ev));
1334+
if (!NodesInfo->Set(std::move(ev))) {
1335+
return;
1336+
}
13141337
for (const auto& ni : NodesInfo->Get()->Nodes) {
13151338
MergedNodeInfo[ni.NodeId] = &ni;
13161339
if (IsStaticNode(ni.NodeId) && needComputeFromStaticNodes) {
@@ -1331,28 +1354,36 @@ class TSelfCheckRequest : public TActorBootstrapped<TSelfCheckRequest> {
13311354

13321355
void Handle(TEvSysView::TEvGetStoragePoolsResponse::TPtr& ev) {
13331356
TabletRequests.CompleteRequest(TTabletRequestsState::RequestStoragePools);
1334-
StoragePools->Set(std::move(ev));
1357+
if (!StoragePools->Set(std::move(ev))) {
1358+
return;
1359+
}
13351360
AggregateBSControllerState();
13361361
RequestDone("TEvGetStoragePoolsRequest");
13371362
}
13381363

13391364
void Handle(TEvSysView::TEvGetGroupsResponse::TPtr& ev) {
13401365
TabletRequests.CompleteRequest(TTabletRequestsState::RequestGroups);
1341-
Groups->Set(std::move(ev));
1366+
if (!Groups->Set(std::move(ev))) {
1367+
return;
1368+
}
13421369
AggregateBSControllerState();
13431370
RequestDone("TEvGetGroupsRequest");
13441371
}
13451372

13461373
void Handle(TEvSysView::TEvGetVSlotsResponse::TPtr& ev) {
13471374
TabletRequests.CompleteRequest(TTabletRequestsState::RequestVSlots);
1348-
VSlots->Set(std::move(ev));
1375+
if (!VSlots->Set(std::move(ev))) {
1376+
return;
1377+
}
13491378
AggregateBSControllerState();
13501379
RequestDone("TEvGetVSlotsRequest");
13511380
}
13521381

13531382
void Handle(TEvSysView::TEvGetPDisksResponse::TPtr& ev) {
13541383
TabletRequests.CompleteRequest(TTabletRequestsState::RequestPDisks);
1355-
PDisks->Set(std::move(ev));
1384+
if (!PDisks->Set(std::move(ev))) {
1385+
return;
1386+
}
13561387
AggregateBSControllerState();
13571388
RequestDone("TEvGetPDisksRequest");
13581389
}
@@ -1361,7 +1392,9 @@ class TSelfCheckRequest : public TActorBootstrapped<TSelfCheckRequest> {
13611392
TabletRequests.CompleteRequest(ev->Cookie);
13621393
TString path = ev->Get()->GetRecord().path();
13631394
auto& response = DescribeByPath[path];
1364-
response.Set(std::move(ev));
1395+
if (!response.Set(std::move(ev))) {
1396+
return;
1397+
}
13651398
if (response.IsOk()) {
13661399
TDatabaseState& state(DatabaseState[path]);
13671400
state.Path = path;
@@ -1399,7 +1432,9 @@ class TSelfCheckRequest : public TActorBootstrapped<TSelfCheckRequest> {
13991432

14001433
void Handle(TEvTxProxySchemeCache::TEvNavigateKeySetResult::TPtr& ev) {
14011434
TRequestResponse<TEvTxProxySchemeCache::TEvNavigateKeySetResult>& response = NavigateKeySet[ev->Get()->Request->Cookie];
1402-
response.Set(std::move(ev));
1435+
if (!response.Set(std::move(ev))) {
1436+
return;
1437+
}
14031438
--NavigateToGo;
14041439
if (response.IsOk()) {
14051440
auto domainInfo = response.Get()->Request->ResultSet.begin()->DomainInfo;
@@ -1459,7 +1494,9 @@ class TSelfCheckRequest : public TActorBootstrapped<TSelfCheckRequest> {
14591494
TInstant aliveBarrier = TInstant::Now() - TDuration::Minutes(5);
14601495
{
14611496
auto& response = HiveNodeStats[hiveId];
1462-
response.Set(std::move(ev));
1497+
if (!response.Set(std::move(ev))) {
1498+
return;
1499+
}
14631500
if (hiveId != RootHiveId) {
14641501
for (const NKikimrHive::THiveNodeStats& hiveStat : response.Get()->Record.GetNodeStats()) {
14651502
if (hiveStat.HasNodeDomain()) {
@@ -1496,13 +1533,17 @@ class TSelfCheckRequest : public TActorBootstrapped<TSelfCheckRequest> {
14961533

14971534
void Handle(TEvHive::TEvResponseHiveInfo::TPtr& ev) {
14981535
TTabletId hiveId = TabletRequests.CompleteRequest(ev->Cookie);
1499-
HiveInfo[hiveId].Set(std::move(ev));
1536+
if (!HiveInfo[hiveId].Set(std::move(ev))) {
1537+
return;
1538+
}
15001539
RequestDone("TEvResponseHiveInfo");
15011540
}
15021541

15031542
void Handle(TEvConsole::TEvListTenantsResponse::TPtr& ev) {
15041543
TabletRequests.CompleteRequest(ev->Cookie);
1505-
ListTenants->Set(std::move(ev));
1544+
if (!ListTenants->Set(std::move(ev))) {
1545+
return;
1546+
}
15061547
RequestSchemeCacheNavigate(DomainPath);
15071548
Ydb::Cms::ListDatabasesResult listTenantsResult;
15081549
ListTenants->Get()->Record.GetResponse().operation().result().UnpackTo(&listTenantsResult);
@@ -1516,7 +1557,9 @@ class TSelfCheckRequest : public TActorBootstrapped<TSelfCheckRequest> {
15161557
void Handle(TEvWhiteboard::TEvSystemStateResponse::TPtr& ev) {
15171558
TNodeId nodeId = ev.Get()->Cookie;
15181559
auto& nodeSystemState(NodeSystemState[nodeId]);
1519-
nodeSystemState.Set(std::move(ev));
1560+
if (!nodeSystemState.Set(std::move(ev))) {
1561+
return;
1562+
}
15201563
RequestDone("TEvSystemStateResponse");
15211564
}
15221565

@@ -2209,21 +2252,27 @@ class TSelfCheckRequest : public TActorBootstrapped<TSelfCheckRequest> {
22092252
void Handle(TEvWhiteboard::TEvVDiskStateResponse::TPtr& ev) {
22102253
TNodeId nodeId = ev.Get()->Cookie;
22112254
auto& nodeVDiskState(NodeVDiskState[nodeId]);
2212-
nodeVDiskState.Set(std::move(ev));
2255+
if (!nodeVDiskState.Set(std::move(ev))) {
2256+
return;
2257+
}
22132258
RequestDone("TEvVDiskStateResponse");
22142259
}
22152260

22162261
void Handle(TEvWhiteboard::TEvPDiskStateResponse::TPtr& ev) {
22172262
TNodeId nodeId = ev.Get()->Cookie;
22182263
auto& nodePDiskState(NodePDiskState[nodeId]);
2219-
nodePDiskState.Set(std::move(ev));
2264+
if (!nodePDiskState.Set(std::move(ev))) {
2265+
return;
2266+
}
22202267
RequestDone("TEvPDiskStateResponse");
22212268
}
22222269

22232270
void Handle(TEvWhiteboard::TEvBSGroupStateResponse::TPtr& ev) {
22242271
ui64 nodeId = ev.Get()->Cookie;
22252272
auto& nodeBSGroupState(NodeBSGroupState[nodeId]);
2226-
nodeBSGroupState.Set(std::move(ev));
2273+
if (!nodeBSGroupState.Set(std::move(ev))) {
2274+
return;
2275+
}
22272276
RequestDone("TEvBSGroupStateResponse");
22282277
}
22292278

ydb/core/health_check/health_check_ut.cpp

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include <ydb/core/node_whiteboard/node_whiteboard.h>
88
#include <ydb/core/blobstorage/base/blobstorage_events.h>
99
#include <ydb/core/protos/config.pb.h>
10+
#include <ydb/core/testlib/actors/block_events.h>
1011
#include <ydb/core/tx/schemeshard/schemeshard.h>
1112
#include "health_check.cpp"
1213

@@ -2348,5 +2349,37 @@ Y_UNIT_TEST_SUITE(THealthCheckTest) {
23482349
auto result = runtime.GrabEdgeEvent<NHealthCheck::TEvSelfCheckResult>(handle)->Result;
23492350
UNIT_ASSERT_VALUES_EQUAL(result.self_check_result(), Ydb::Monitoring::SelfCheck::GOOD);
23502351
}
2352+
2353+
Y_UNIT_TEST(TestNodeDisconnected) {
2354+
TPortManager tp;
2355+
ui16 port = tp.GetPort(2134);
2356+
ui16 grpcPort = tp.GetPort(2135);
2357+
auto settings = TServerSettings(port)
2358+
.SetNodeCount(1)
2359+
.SetUseRealThreads(false)
2360+
.SetDomainName("Root");
2361+
TServer server(settings);
2362+
server.EnableGRpc(grpcPort);
2363+
TClient client(settings);
2364+
TTestActorRuntime& runtime = *server.GetRuntime();
2365+
2366+
TActorId sender = runtime.AllocateEdgeActor();
2367+
TAutoPtr<IEventHandle> handle;
2368+
2369+
auto observer = runtime.AddObserver<TEvWhiteboard::TEvSystemStateResponse>([&](auto&& ev) {
2370+
auto actor = ev->Recipient;
2371+
auto nodeId = ev->Sender.NodeId();
2372+
Cerr << "Observing " << ev->ToString() << Endl;
2373+
runtime.Send(ev.Release());
2374+
runtime.Send(new IEventHandle(actor, sender, new TEvInterconnect::TEvNodeDisconnected(nodeId)));
2375+
});
2376+
2377+
TBlockEvents<TEvHive::TEvResponseHiveInfo> block(runtime); // just make it arrive later
2378+
runtime.Send(new IEventHandle(NHealthCheck::MakeHealthCheckID(), sender, new NHealthCheck::TEvSelfCheckRequest(), 0));
2379+
runtime.DispatchEvents({}, TDuration::MilliSeconds(500));
2380+
block.Stop().Unblock();
2381+
auto result = runtime.GrabEdgeEvent<NHealthCheck::TEvSelfCheckResult>(handle)->Result;
2382+
UNIT_ASSERT_VALUES_EQUAL(result.self_check_result(), Ydb::Monitoring::SelfCheck::GOOD);
2383+
}
23512384
}
23522385
}

0 commit comments

Comments
 (0)