Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issue-2947: don't backup tablet info in temporary server #2978

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cloud/blockstore/libs/daemon/ydb/bootstrap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,7 @@ void TBootstrapYdb::InitKikimrService()
args.VolumeBalancerSwitch = VolumeBalancerSwitch;
args.EndpointEventHandler = EndpointEventHandler;
args.RootKmsKeyProvider = RootKmsKeyProvider;
args.TemporaryServer = Configs->Options->TemporaryServer;

ActorSystem = NStorage::CreateActorSystem(args);

Expand Down
14 changes: 10 additions & 4 deletions cloud/blockstore/libs/storage/init/server/actorsystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,17 @@ class TStorageServicesInitializer final
//

auto hiveProxy = CreateHiveProxy({
.PipeClientRetryCount = Args.StorageConfig->GetPipeClientRetryCount(),
.PipeClientMinRetryTime = Args.StorageConfig->GetPipeClientMinRetryTime(),
.HiveLockExpireTimeout = Args.StorageConfig->GetHiveLockExpireTimeout(),
.PipeClientRetryCount =
Args.StorageConfig->GetPipeClientRetryCount(),
.PipeClientMinRetryTime =
Args.StorageConfig->GetPipeClientMinRetryTime(),
.HiveLockExpireTimeout =
Args.StorageConfig->GetHiveLockExpireTimeout(),
.LogComponent = TBlockStoreComponents::HIVE_PROXY,
.TabletBootInfoBackupFilePath = Args.StorageConfig->GetTabletBootInfoBackupFilePath(),
.TabletBootInfoBackupFilePath =
Args.TemporaryServer
? TString()
: Args.StorageConfig->GetTabletBootInfoBackupFilePath(),
.FallbackMode = Args.StorageConfig->GetHiveProxyFallbackMode(),
.TenantHiveTabletId = Args.StorageConfig->GetTenantHiveTabletId(),
});
Expand Down
1 change: 1 addition & 0 deletions cloud/blockstore/libs/storage/init/server/actorsystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ struct TServerActorSystemArgs
TVector<NCloud::NStorage::IUserMetricsSupplierPtr> UserCounterProviders;

bool IsDiskRegistrySpareNode = false;
bool TemporaryServer = false;
};

////////////////////////////////////////////////////////////////////////////////
Expand Down
20 changes: 16 additions & 4 deletions cloud/storage/core/libs/hive_proxy/hive_proxy_ut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1103,15 +1103,27 @@ Y_UNIT_TEST_SUITE(THiveProxyTest)
UNIT_ASSERT(env.HiveState->DownNodeIds.contains(sender.NodeId()));
}

Y_UNIT_TEST(DontBackupWithEmptyBootInfoFilePath)
{
TString backupFilePath = "";

TTestBasicRuntime runtime;
TTestEnv env(runtime, backupFilePath);

auto sender = runtime.AllocateEdgeActor();

env.SendBackupTabletBootInfos(sender, S_FALSE);
}

Y_UNIT_TEST(BootExternalInFallbackMode)
{
TString cacheFilePath =
"BootExternalInFallbackMode.tablet_boot_info_cache.txt";;
TString backupFilePath =
"BootExternalInFallbackMode.tablet_boot_info_backup.txt";
bool fallbackMode = false;

{
TTestBasicRuntime runtime;
TTestEnv env(runtime, cacheFilePath, fallbackMode);
TTestEnv env(runtime, backupFilePath, fallbackMode);

TTabletStorageInfoPtr expected = CreateTestTabletInfo(
FakeTablet2,
Expand All @@ -1137,7 +1149,7 @@ Y_UNIT_TEST_SUITE(THiveProxyTest)
fallbackMode = true;
{
TTestBasicRuntime runtime;
TTestEnv env(runtime, cacheFilePath, fallbackMode);
TTestEnv env(runtime, backupFilePath, fallbackMode);

auto sender = runtime.AllocateEdgeActor();

Expand Down
Loading