Skip to content

Commit

Permalink
randomize default spilling root (#6781)
Browse files Browse the repository at this point in the history
  • Loading branch information
gridnevvvit authored and lll-phill-lll committed Sep 12, 2024
1 parent 08a390b commit a28fda5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions ydb/core/kqp/proxy_service/kqp_proxy_service.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
#include <library/cpp/lwtrace/mon/mon_lwtrace.h>
#include <library/cpp/monlib/service/pages/templates.h>
#include <library/cpp/resource/resource.h>

#include <util/generic/guid.h>

namespace NKikimr::NKqp {

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

if (auto& cfg = TableServiceConfig.GetSpillingServiceConfig().GetLocalFileConfig(); cfg.GetEnable()) {
TString spillingRoot = cfg.GetRoot();
if (spillingRoot.empty()) {
spillingRoot = TStringBuilder() << "/tmp/ydb_spilling_" << CreateGuidAsString() << "/";
}

SpillingService = TlsActivationContext->ExecutorThread.RegisterActor(NYql::NDq::CreateDqLocalFileSpillingService(
NYql::NDq::TFileSpillingServiceConfig{
.Root = cfg.GetRoot(),
.Root = spillingRoot,
.MaxTotalSize = cfg.GetMaxTotalSize(),
.MaxFileSize = cfg.GetMaxFileSize(),
.MaxFilePartSize = cfg.GetMaxFilePartSize(),
Expand Down
2 changes: 1 addition & 1 deletion ydb/core/protos/table_service_config.proto
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ message TTableServiceConfig {
message TSpillingServiceConfig {
message TLocalFileConfig {
optional bool Enable = 1 [default = true];
optional string Root = 2 [default = "/tmp/kikimr_spilling/"];
optional string Root = 2 [default = ""];
optional uint64 MaxTotalSize = 3 [default = 21474836480]; // 20 GiB
optional uint64 MaxFileSize = 4 [default = 5368709120]; // 5 GiB
optional uint64 MaxFilePartSize = 5 [default = 104857600]; // 100 MB
Expand Down

0 comments on commit a28fda5

Please sign in to comment.