Skip to content

Commit dec1470

Browse files
committed
randomize spilling root
1 parent 2757f82 commit dec1470

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

ydb/core/kqp/proxy_service/kqp_proxy_service.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ using VSessions = NKikimr::NSysView::Schema::QuerySessions;
7171
using namespace NKikimrConfig;
7272

7373

74+
TString RandomSpillingRootString() {
75+
return ToString(RandomNumber<ui32>());
76+
}
77+
7478
std::optional<ui32> TryDecodeYdbSessionId(const TString& sessionId) {
7579
if (sessionId.empty()) {
7680
return std::nullopt;
@@ -234,9 +238,14 @@ class TKqpProxyService : public TActorBootstrapped<TKqpProxyService> {
234238
WhiteBoardService = NNodeWhiteboard::MakeNodeWhiteboardServiceId(SelfId().NodeId());
235239

236240
if (auto& cfg = TableServiceConfig.GetSpillingServiceConfig().GetLocalFileConfig(); cfg.GetEnable()) {
241+
TString spillingRoot = cfg.GetRoot();
242+
if (spillingRoot.empty()) {
243+
spillingRoot = TStringBuilder() << "/tmp/ydb_spilling_" << RandomSpillingRootString() << "/";
244+
}
245+
237246
SpillingService = TlsActivationContext->ExecutorThread.RegisterActor(NYql::NDq::CreateDqLocalFileSpillingService(
238247
NYql::NDq::TFileSpillingServiceConfig{
239-
.Root = cfg.GetRoot(),
248+
.Root = spillingRoot,
240249
.MaxTotalSize = cfg.GetMaxTotalSize(),
241250
.MaxFileSize = cfg.GetMaxFileSize(),
242251
.MaxFilePartSize = cfg.GetMaxFilePartSize(),

ydb/core/protos/table_service_config.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ message TTableServiceConfig {
4848
message TSpillingServiceConfig {
4949
message TLocalFileConfig {
5050
optional bool Enable = 1 [default = true];
51-
optional string Root = 2 [default = "/tmp/kikimr_spilling/"];
51+
optional string Root = 2 [default = ""];
5252
optional uint64 MaxTotalSize = 3 [default = 21474836480]; // 20 GiB
5353
optional uint64 MaxFileSize = 4 [default = 5368709120]; // 5 GiB
5454
optional uint64 MaxFilePartSize = 5 [default = 104857600]; // 100 MB

0 commit comments

Comments
 (0)