Skip to content

Commit a28fda5

Browse files
gridnevvvitlll-phill-lll
authored andcommitted
randomize default spilling root (#6781)
1 parent 08a390b commit a28fda5

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

ydb/core/kqp/proxy_service/kqp_proxy_service.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
#include <library/cpp/lwtrace/mon/mon_lwtrace.h>
4646
#include <library/cpp/monlib/service/pages/templates.h>
4747
#include <library/cpp/resource/resource.h>
48-
48+
#include <util/generic/guid.h>
4949

5050
namespace NKikimr::NKqp {
5151

@@ -236,9 +236,14 @@ class TKqpProxyService : public TActorBootstrapped<TKqpProxyService> {
236236
ResourcePoolsCache.UpdateFeatureFlags(FeatureFlags, ActorContext());
237237

238238
if (auto& cfg = TableServiceConfig.GetSpillingServiceConfig().GetLocalFileConfig(); cfg.GetEnable()) {
239+
TString spillingRoot = cfg.GetRoot();
240+
if (spillingRoot.empty()) {
241+
spillingRoot = TStringBuilder() << "/tmp/ydb_spilling_" << CreateGuidAsString() << "/";
242+
}
243+
239244
SpillingService = TlsActivationContext->ExecutorThread.RegisterActor(NYql::NDq::CreateDqLocalFileSpillingService(
240245
NYql::NDq::TFileSpillingServiceConfig{
241-
.Root = cfg.GetRoot(),
246+
.Root = spillingRoot,
242247
.MaxTotalSize = cfg.GetMaxTotalSize(),
243248
.MaxFileSize = cfg.GetMaxFileSize(),
244249
.MaxFilePartSize = cfg.GetMaxFilePartSize(),

ydb/core/protos/table_service_config.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ message TTableServiceConfig {
5656
message TSpillingServiceConfig {
5757
message TLocalFileConfig {
5858
optional bool Enable = 1 [default = true];
59-
optional string Root = 2 [default = "/tmp/kikimr_spilling/"];
59+
optional string Root = 2 [default = ""];
6060
optional uint64 MaxTotalSize = 3 [default = 21474836480]; // 20 GiB
6161
optional uint64 MaxFileSize = 4 [default = 5368709120]; // 5 GiB
6262
optional uint64 MaxFilePartSize = 5 [default = 104857600]; // 100 MB

0 commit comments

Comments
 (0)