@@ -16,8 +16,11 @@ Y_UNIT_TEST_SUITE(TSchemeShardMoveRebootsTest) {
16
16
TTestEnv env (runtime);
17
17
}
18
18
19
- Y_UNIT_TEST ( WithData) {
19
+ void WithData ( bool enablePersistentPartitionStats, bool enableLocalDBBtreeIndex ) {
20
20
TTestWithReboots t;
21
+ t.GetTestEnvOptions ()
22
+ .EnableLocalDBBtreeIndex (enableLocalDBBtreeIndex)
23
+ .EnablePersistentPartitionStats (enablePersistentPartitionStats);
21
24
22
25
t.Run ([&](TTestActorRuntime& runtime, bool & activeZone) {
23
26
TPathVersion pathVersion;
@@ -72,7 +75,7 @@ Y_UNIT_TEST_SUITE(TSchemeShardMoveRebootsTest) {
72
75
}
73
76
74
77
TestDescribeResult (DescribePath (runtime, " /MyRoot" ),
75
- {NLs::DatabaseSizeIs (120 )});
78
+ {NLs::DatabaseSizeIs (enableLocalDBBtreeIndex ? 58 : 120 )});
76
79
77
80
}
78
81
@@ -104,106 +107,21 @@ Y_UNIT_TEST_SUITE(TSchemeShardMoveRebootsTest) {
104
107
}
105
108
106
109
TestDescribeResult (DescribePath (runtime, " /MyRoot" ),
107
- {NLs::DatabaseSizeIs (120 )});
110
+ {NLs::DatabaseSizeIs (enableLocalDBBtreeIndex ? 58 : 120 )});
108
111
}
109
112
});
110
113
}
111
114
112
- Y_UNIT_TEST (WithDataAndPersistentPartitionStats) {
113
- TTestWithReboots t;
114
- t.GetTestEnvOptions ().EnablePersistentPartitionStats (true );
115
-
116
- t.Run ([&](TTestActorRuntime& runtime, bool & activeZone) {
117
- TPathVersion pathVersion;
118
- {
119
- TInactiveZone inactive (activeZone);
120
- TestCreateTable (runtime, ++t.TxId , " /MyRoot" , R"(
121
- Name: "Table"
122
- Columns { Name: "key" Type: "Uint64" }
123
- Columns { Name: "value" Type: "Utf8" }
124
- KeyColumnNames: ["key"]
125
- )" );
126
- t.TestEnv ->TestWaitNotification (runtime, t.TxId );
127
-
128
- // Write some data to the user table
129
- auto fnWriteRow = [&] (ui64 tabletId) {
130
- TString writeQuery = R"(
131
- (
132
- (let key '( '('key (Uint64 '0)) ) )
133
- (let value '('('value (Utf8 '281474980010683)) ) )
134
- (return (AsList (UpdateRow '__user__Table key value) ))
135
- )
136
- )" ;
137
- NKikimrMiniKQL::TResult result;
138
- TString err;
139
- NKikimrProto::EReplyStatus status = LocalMiniKQL (runtime, tabletId, writeQuery, result, err);
140
- UNIT_ASSERT_VALUES_EQUAL (err, " " );
141
- UNIT_ASSERT_VALUES_EQUAL (status, NKikimrProto::EReplyStatus::OK);;
142
- };
143
- fnWriteRow (TTestTxConfig::FakeHiveTablets);
144
-
145
- pathVersion = TestDescribeResult (DescribePath (runtime, " /MyRoot" ),
146
- {NLs::PathExist,
147
- NLs::ChildrenCount (2 ),
148
- NLs::ShardsInsideDomain (1 )});
149
-
150
- auto tableVersion = TestDescribeResult (DescribePath (runtime, " /MyRoot/Table" ),
151
- {NLs::PathExist});
152
- {
153
- const auto result = CompactTable (runtime, TTestTxConfig::FakeHiveTablets, tableVersion.PathId );
154
- UNIT_ASSERT_VALUES_EQUAL (result.GetStatus (), NKikimrTxDataShard::TEvCompactTableResult::OK);
155
- }
156
-
157
- { // wait stats
158
- TVector<THolder<IEventHandle>> suppressed;
159
- auto prevObserver = SetSuppressObserver (runtime, suppressed, TEvDataShard::TEvPeriodicTableStats::EventType);
160
-
161
- WaitForSuppressed (runtime, suppressed, 1 , prevObserver);
162
- for (auto &msg : suppressed) {
163
- runtime.Send (msg.Release ());
164
- }
165
- suppressed.clear ();
166
- }
167
-
168
- TestDescribeResult (DescribePath (runtime, " /MyRoot" ),
169
- {NLs::DatabaseSizeIs (120 )});
170
-
171
- }
172
-
173
- t.TestEnv ->ReliablePropose (runtime, MoveTableRequest (++t.TxId , " /MyRoot/Table" , " /MyRoot/TableMove" , TTestTxConfig::SchemeShard, {pathVersion}),
174
- {NKikimrScheme::StatusAccepted, NKikimrScheme::StatusMultipleModifications, NKikimrScheme::StatusPreconditionFailed});
175
-
176
- TestDescribeResult (DescribePath (runtime, " /MyRoot" ),
177
- {NLs::DatabaseSizeIs (120 )});
178
-
179
- t.TestEnv ->TestWaitNotification (runtime, t.TxId );
180
-
181
- {
182
- TInactiveZone inactive (activeZone);
183
- TestDescribeResult (DescribePath (runtime, " /MyRoot" ),
184
- {NLs::ChildrenCount (2 ),
185
- NLs::ShardsInsideDomain (1 )});
186
- TestDescribeResult (DescribePath (runtime, " /MyRoot/TableMove" ),
187
- {NLs::PathVersionEqual (5 ),
188
- NLs::IsTable});
189
- TestDescribeResult (DescribePath (runtime, " /MyRoot/Table" ),
190
- {NLs::PathNotExist});
191
-
192
- { // wait stats
193
- TVector<THolder<IEventHandle>> suppressed;
194
- auto prevObserver = SetSuppressObserver (runtime, suppressed, TEvDataShard::TEvPeriodicTableStats::EventType);
115
+ Y_UNIT_TEST (WithData) {
116
+ WithData (false , false );
117
+ }
195
118
196
- WaitForSuppressed (runtime, suppressed, 1 , prevObserver);
197
- for (auto &msg : suppressed) {
198
- runtime.Send (msg.Release ());
199
- }
200
- suppressed.clear ();
201
- }
119
+ Y_UNIT_TEST (WithDataAndPersistentPartitionStats) {
120
+ WithData (true , false );
121
+ }
202
122
203
- TestDescribeResult (DescribePath (runtime, " /MyRoot" ),
204
- {NLs::DatabaseSizeIs (120 )});
205
- }
206
- });
123
+ Y_UNIT_TEST (WithDataAndLocalDBBtreeIndex) {
124
+ WithData (false , true );
207
125
}
208
126
209
127
Y_UNIT_TEST (MoveIndex) {
0 commit comments