aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsabdenovch <sabdenovch@yandex-team.com>2024-10-04 11:03:04 +0300
committersabdenovch <sabdenovch@yandex-team.com>2024-10-04 11:17:23 +0300
commit9a6b8cb5c502ba2b158c337ce13e983e3c3dc78f (patch)
tree6d30a51265ee750252e6cfed442d74f0ca6cfbe3
parent19d4673382658aafc539ebfe03fe7e297a3aa261 (diff)
downloadydb-9a6b8cb5c502ba2b158c337ce13e983e3c3dc78f.tar.gz
Remove logs from page cache
commit_hash:6f02b7293c6e72013969f048048f423b7f2201f6
-rw-r--r--yt/yt/core/logging/config.cpp2
-rw-r--r--yt/yt/core/logging/config.h1
-rw-r--r--yt/yt/core/logging/file_log_writer.cpp19
3 files changed, 21 insertions, 1 deletions
diff --git a/yt/yt/core/logging/config.cpp b/yt/yt/core/logging/config.cpp
index e94e4b51fd..4acde166a9 100644
--- a/yt/yt/core/logging/config.cpp
+++ b/yt/yt/core/logging/config.cpp
@@ -104,6 +104,8 @@ void TFileLogWriterConfig::Register(TRegistrar registrar)
.Default(false);
registrar.Parameter("enable_compression", &TThis::EnableCompression)
.Default(false);
+ registrar.Parameter("enable_no_reuse", &TThis::EnableNoReuse)
+ .Default(false);
registrar.Parameter("compression_method", &TThis::CompressionMethod)
.Default(ECompressionMethod::Gzip);
registrar.Parameter("compression_level", &TThis::CompressionLevel)
diff --git a/yt/yt/core/logging/config.h b/yt/yt/core/logging/config.h
index a959e5968a..6e5f2b0f9f 100644
--- a/yt/yt/core/logging/config.h
+++ b/yt/yt/core/logging/config.h
@@ -82,6 +82,7 @@ public:
TString FileName;
bool UseTimestampSuffix;
bool EnableCompression;
+ bool EnableNoReuse;
ECompressionMethod CompressionMethod;
int CompressionLevel;
diff --git a/yt/yt/core/logging/file_log_writer.cpp b/yt/yt/core/logging/file_log_writer.cpp
index 1bad6030c5..d72c2f4e07 100644
--- a/yt/yt/core/logging/file_log_writer.cpp
+++ b/yt/yt/core/logging/file_log_writer.cpp
@@ -152,9 +152,26 @@ private:
TFlags<EOpenModeFlag> openMode;
if (Config_->EnableCompression) {
- openMode = OpenAlways|RdWr|CloseOnExec;
+ switch (Config_->CompressionMethod) {
+ case ECompressionMethod::Zstd:
+ openMode = OpenAlways|RdWr|CloseOnExec;
+ if (Config_->EnableNoReuse) {
+ openMode = openMode|NoReuse;
+ }
+ break;
+
+ case ECompressionMethod::Gzip:
+ openMode = OpenAlways|RdWr|CloseOnExec;
+ break;
+
+ default:
+ YT_ABORT();
+ }
} else {
openMode = OpenAlways|ForAppend|WrOnly|Seq|CloseOnExec;
+ if (Config_->EnableNoReuse) {
+ openMode = openMode|NoReuse;
+ }
}
// Generate filename.