@@ -31,17 +31,13 @@ class TCacheTest: public TTestWithSchemeshard {
3131 SchemeCache = Context->Register (CreateSchemeBoardSchemeCache (config.Get ()));
3232 Context->EnableScheduleForActor (SchemeCache, true );
3333
34- TestAlterSubDomain (*Context, 1 , " /" ,
35- " StoragePools { "
36- " Name: \" pool-1\" "
37- " Kind: \" pool-kind-1\" "
38- " } "
39- " Name: \" Root\" " );
40-
41- // Context->SetLogPriority(NKikimrServices::SCHEME_BOARD_REPLICA, NLog::PRI_DEBUG);
42- // Context->SetLogPriority(NKikimrServices::SCHEME_BOARD_SUBSCRIBER, NLog::PRI_DEBUG);
43- // Context->SetLogPriority(NKikimrServices::TX_PROXY_SCHEME_CACHE, NLog::PRI_DEBUG);
44- // Context->SetLogPriority(NKikimrServices::FLAT_TX_SCHEMESHARD, NLog::PRI_DEBUG);
34+ TestAlterSubDomain (*Context, 1 , " /" , R"(
35+ Name: "Root"
36+ StoragePools {
37+ Name: "pool-1"
38+ Kind: "pool-kind-1"
39+ }
40+ )" );
4541 }
4642
4743 UNIT_TEST_SUITE (TCacheTest);
@@ -63,6 +59,7 @@ class TCacheTest: public TTestWithSchemeshard {
6359 UNIT_TEST (MigrationDeletedPathNavigate);
6460 UNIT_TEST (WatchRoot);
6561 UNIT_TEST (PathBelongsToDomain);
62+ UNIT_TEST (CookiesArePreserved);
6663 UNIT_TEST_SUITE_END ();
6764
6865 void Navigate ();
@@ -83,10 +80,11 @@ class TCacheTest: public TTestWithSchemeshard {
8380 void MigrationDeletedPathNavigate ();
8481 void WatchRoot ();
8582 void PathBelongsToDomain ();
83+ void CookiesArePreserved ();
8684
8785protected:
8886 TNavigate::TEntry TestNavigateImpl (THolder<TNavigate> request, TNavigate::EStatus expectedStatus,
89- const TString& sid, TNavigate::EOp op, bool showPrivatePath, bool redirectRequired);
87+ const TString& sid, TNavigate::EOp op, bool showPrivatePath, bool redirectRequired, ui64 cookie = 0 );
9088
9189 TNavigate::TEntry TestNavigate (const TString& path, TNavigate::EStatus expectedStatus = TNavigate::EStatus::Ok,
9290 const TString& sid = TString(), TNavigate::EOp op = TNavigate::EOp::OpPath,
@@ -374,7 +372,7 @@ void TCacheTest::TableSchemaVersion() {
374372}
375373
376374TNavigate::TEntry TCacheTest::TestNavigateImpl (THolder<TNavigate> request, TNavigate::EStatus expectedStatus,
377- const TString& sid, TNavigate::EOp op, bool showPrivatePath, bool redirectRequired)
375+ const TString& sid, TNavigate::EOp op, bool showPrivatePath, bool redirectRequired, ui64 cookie )
378376{
379377 auto & entry = request->ResultSet .back ();
380378 entry.Operation = op;
@@ -386,10 +384,11 @@ TNavigate::TEntry TCacheTest::TestNavigateImpl(THolder<TNavigate> request, TNavi
386384 }
387385
388386 const TActorId edge = Context->AllocateEdgeActor ();
389- Context->Send (SchemeCache, edge, new TEvTxProxySchemeCache::TEvNavigateKeySet (request.Release ()), 0 , 0 , 0 , true );
387+ Context->Send (SchemeCache, edge, new TEvTxProxySchemeCache::TEvNavigateKeySet (request.Release ()), 0 , cookie , 0 , true );
390388 auto ev = Context->GrabEdgeEvent <TEvTxProxySchemeCache::TEvNavigateKeySetResult>(edge);
391389
392390 UNIT_ASSERT (ev->Get ());
391+ UNIT_ASSERT_VALUES_EQUAL (ev->Cookie , cookie);
393392 UNIT_ASSERT (!ev->Get ()->Request ->ResultSet .empty ());
394393
395394 const TNavigate::TEntry result = ev->Get ()->Request ->ResultSet [0 ];
@@ -997,6 +996,25 @@ void TCacheTest::PathBelongsToDomain() {
997996 }
998997}
999998
999+ void TCacheTest::CookiesArePreserved () {
1000+ ui64 txId = 100 ;
1001+ TestCreateSubDomain (*Context, ++txId, " /Root" , R"( Name: "SubDomain")" );
1002+ TestWaitNotification (*Context, {txId}, CreateNotificationSubscriber (*Context, TTestTxConfig::SchemeShard));
1003+ TestMkDir (*Context, ++txId, " /Root/SubDomain" , " DirA" );
1004+
1005+ ui64 cookie = 1 ;
1006+ // first request will run db resolver
1007+ for (int i = 0 ; i < 2 ; ++i) {
1008+ auto request = MakeHolder<TNavigate>();
1009+ request->DatabaseName = " /Root/SubDomain" ;
1010+ auto & entry = request->ResultSet .emplace_back ();
1011+ entry.Path = SplitPath (" /Root/SubDomain/DirA" );
1012+ entry.RequestType = TNavigate::TEntry::ERequestType::ByPath;
1013+ auto result = TestNavigateImpl (std::move (request), TNavigate::EStatus::Ok,
1014+ " " , TNavigate::EOp::OpPath, false , true , ++cookie);
1015+ }
1016+ }
1017+
10001018class TCacheTestWithDrops : public TCacheTest {
10011019public:
10021020 TTestContext::TEventObserver ObserverFunc () override {
0 commit comments