aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbarkovbg <barkovbg@yandex-team.com>2023-08-08 12:15:35 +0300
committerbarkovbg <barkovbg@yandex-team.com>2023-08-08 13:32:45 +0300
commitccbe2bda5b165c7434b7e883b321f109d03fdf86 (patch)
tree470598aac9a8ea2bd86e988e3591a69972a1aaca
parent6531528c7f69c09862eb0c8449c970aa98e0a623 (diff)
downloadydb-ccbe2bda5b165c7434b7e883b321f109d03fdf86.tar.gz
[blockstore]Replace FillToken with FillGeneration
-rw-r--r--ydb/core/protos/blockstore_config.proto5
-rw-r--r--ydb/core/tx/schemeshard/schemeshard__operation_alter_bsv.cpp6
-rw-r--r--ydb/core/tx/schemeshard/ut_base.cpp10
3 files changed, 12 insertions, 9 deletions
diff --git a/ydb/core/protos/blockstore_config.proto b/ydb/core/protos/blockstore_config.proto
index f4674d6f11a..ab8fe9618e1 100644
--- a/ydb/core/protos/blockstore_config.proto
+++ b/ydb/core/protos/blockstore_config.proto
@@ -131,8 +131,11 @@ message TVolumeConfig {
// Is disk filling finished.
optional bool IsFillFinished = 49;
- // Mount requests with incorrect FillToken will be rejected unless filling is finished.
+ // TODO: delete this field.
optional string FillToken = 50;
+
+ // Mount requests with incorrect FillGeneration will be rejected unless filling is finished.
+ optional uint64 FillGeneration = 51;
}
message TUpdateVolumeConfig {
diff --git a/ydb/core/tx/schemeshard/schemeshard__operation_alter_bsv.cpp b/ydb/core/tx/schemeshard/schemeshard__operation_alter_bsv.cpp
index 23e6e85f38a..20fd893104f 100644
--- a/ydb/core/tx/schemeshard/schemeshard__operation_alter_bsv.cpp
+++ b/ydb/core/tx/schemeshard/schemeshard__operation_alter_bsv.cpp
@@ -531,12 +531,12 @@ public:
return result;
}
- if (alterVolumeConfig->HasFillToken() &&
- alterVolumeConfig->GetFillToken() != volume->VolumeConfig.GetFillToken())
+ if (alterVolumeConfig->HasFillGeneration() &&
+ alterVolumeConfig->GetFillGeneration() != volume->VolumeConfig.GetFillGeneration())
{
result->SetError(
NKikimrScheme::StatusPreconditionFailed,
- "Wrong FillToken in VolumeConfig");
+ "Wrong FillGeneration in VolumeConfig");
return result;
}
diff --git a/ydb/core/tx/schemeshard/ut_base.cpp b/ydb/core/tx/schemeshard/ut_base.cpp
index a998236c9ec..99016d088d8 100644
--- a/ydb/core/tx/schemeshard/ut_base.cpp
+++ b/ydb/core/tx/schemeshard/ut_base.cpp
@@ -8328,7 +8328,7 @@ Y_UNIT_TEST_SUITE(TSchemeShardTest) {
env.TestWaitNotification(runtime, txId);
}
- Y_UNIT_TEST(AssignBlockStoreCheckFillTokenInAlter) { //+
+ Y_UNIT_TEST(AssignBlockStoreCheckFillGenerationInAlter) { //+
TTestBasicRuntime runtime;
TTestEnv env(runtime);
ui64 txId = 100;
@@ -8337,7 +8337,7 @@ Y_UNIT_TEST_SUITE(TSchemeShardTest) {
vdescr.SetName("BSVolume");
auto& vc = *vdescr.MutableVolumeConfig();
vc.SetBlockSize(4096);
- vc.SetFillToken("barkovbg");
+ vc.SetFillGeneration(1);
vc.AddPartitions()->SetBlockCount(16);
vc.AddExplicitChannelProfiles()->SetPoolKind("pool-kind-1");
vc.AddExplicitChannelProfiles()->SetPoolKind("pool-kind-1");
@@ -8348,7 +8348,7 @@ Y_UNIT_TEST_SUITE(TSchemeShardTest) {
env.TestWaitNotification(runtime, txId);
vc.Clear();
- vc.SetFillToken("barkovbg");
+ vc.SetFillGeneration(1);
vc.AddPartitions()->SetBlockCount(24);
vc.AddPartitions()->SetBlockCount(24);
@@ -8356,7 +8356,7 @@ Y_UNIT_TEST_SUITE(TSchemeShardTest) {
env.TestWaitNotification(runtime, txId);
vc.Clear();
- vc.SetFillToken("svartmetal");
+ vc.SetFillGeneration(2);
vc.AddPartitions()->SetBlockCount(25);
vc.AddPartitions()->SetBlockCount(25);
@@ -8366,7 +8366,7 @@ Y_UNIT_TEST_SUITE(TSchemeShardTest) {
env.TestWaitNotification(runtime, txId);
vc.Clear();
- vc.SetFillToken("barkovbg");
+ vc.SetFillGeneration(1);
vc.AddPartitions()->SetBlockCount(48);
vc.AddPartitions()->SetBlockCount(48);