From e2954b918e6b254e383ad8eb27cdfa9e3f190f53 Mon Sep 17 00:00:00 2001 From: Marco Neumann Date: Fri, 16 Apr 2021 12:41:12 +0200 Subject: [PATCH] fix: set defaults for `persist` and `drop_non_persisted` to `true` This should prevent writer deaths for default configs. Closes #1225. --- data_types/src/database_rules.rs | 1 + .../protos/influxdata/iox/management/v1/database_rules.proto | 1 + src/commands/database.rs | 5 +++-- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/data_types/src/database_rules.rs b/data_types/src/database_rules.rs index 83f0d72d2d..8071a812f7 100644 --- a/data_types/src/database_rules.rs +++ b/data_types/src/database_rules.rs @@ -207,6 +207,7 @@ pub struct LifecycleRules { pub sort_order: SortOrder, /// Allow dropping data that has not been persisted to object storage + /// once the database size has exceeded the configured limits pub drop_non_persisted: bool, /// Persists chunks to object storage. diff --git a/generated_types/protos/influxdata/iox/management/v1/database_rules.proto b/generated_types/protos/influxdata/iox/management/v1/database_rules.proto index 5ee66d0e1b..eb0d565673 100644 --- a/generated_types/protos/influxdata/iox/management/v1/database_rules.proto +++ b/generated_types/protos/influxdata/iox/management/v1/database_rules.proto @@ -149,6 +149,7 @@ message LifecycleRules { SortOrder sort_order = 6; // Allow dropping data that has not been persisted to object storage + // once the database size has exceeded the configured limits bool drop_non_persisted = 7; // Persists chunks to object storage. diff --git a/src/commands/database.rs b/src/commands/database.rs index 29e12d5694..f7db7697f7 100644 --- a/src/commands/database.rs +++ b/src/commands/database.rs @@ -102,11 +102,12 @@ struct Create { buffer_size_hard: usize, /// Allow dropping data that has not been persisted to object storage - #[structopt(long)] + /// once the database size has exceeded the configured limits + #[structopt(long = "drop-persisted-only", parse(from_flag = std::ops::Not::not))] drop_non_persisted: bool, /// Persists chunks to object storage. - #[structopt(long)] + #[structopt(long = "skip-persist", parse(from_flag = std::ops::Not::not))] persist: bool, /// Do not allow writing new data to this database