@@ -31,17 +31,13 @@ class TCacheTest: public TTestWithSchemeshard {
31
31
SchemeCache = Context->Register (CreateSchemeBoardSchemeCache (config.Get ()));
32
32
Context->EnableScheduleForActor (SchemeCache, true );
33
33
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
+ )" );
45
41
}
46
42
47
43
UNIT_TEST_SUITE (TCacheTest);
@@ -63,6 +59,7 @@ class TCacheTest: public TTestWithSchemeshard {
63
59
UNIT_TEST (MigrationDeletedPathNavigate);
64
60
UNIT_TEST (WatchRoot);
65
61
UNIT_TEST (PathBelongsToDomain);
62
+ UNIT_TEST (CookiesArePreserved);
66
63
UNIT_TEST_SUITE_END ();
67
64
68
65
void Navigate ();
@@ -83,10 +80,11 @@ class TCacheTest: public TTestWithSchemeshard {
83
80
void MigrationDeletedPathNavigate ();
84
81
void WatchRoot ();
85
82
void PathBelongsToDomain ();
83
+ void CookiesArePreserved ();
86
84
87
85
protected:
88
86
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 );
90
88
91
89
TNavigate::TEntry TestNavigate (const TString& path, TNavigate::EStatus expectedStatus = TNavigate::EStatus::Ok,
92
90
const TString& sid = TString(), TNavigate::EOp op = TNavigate::EOp::OpPath,
@@ -374,7 +372,7 @@ void TCacheTest::TableSchemaVersion() {
374
372
}
375
373
376
374
TNavigate::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 )
378
376
{
379
377
auto & entry = request->ResultSet .back ();
380
378
entry.Operation = op;
@@ -386,10 +384,11 @@ TNavigate::TEntry TCacheTest::TestNavigateImpl(THolder<TNavigate> request, TNavi
386
384
}
387
385
388
386
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 );
390
388
auto ev = Context->GrabEdgeEvent <TEvTxProxySchemeCache::TEvNavigateKeySetResult>(edge);
391
389
392
390
UNIT_ASSERT (ev->Get ());
391
+ UNIT_ASSERT_VALUES_EQUAL (ev->Cookie , cookie);
393
392
UNIT_ASSERT (!ev->Get ()->Request ->ResultSet .empty ());
394
393
395
394
const TNavigate::TEntry result = ev->Get ()->Request ->ResultSet [0 ];
@@ -997,6 +996,25 @@ void TCacheTest::PathBelongsToDomain() {
997
996
}
998
997
}
999
998
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
+
1000
1018
class TCacheTestWithDrops : public TCacheTest {
1001
1019
public:
1002
1020
TTestContext::TEventObserver ObserverFunc () override {
0 commit comments