Add option to bypass dropped column erasure.
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
@@ -1273,6 +1273,20 @@ pub struct Config {
|
||||
#[serde(default = "default_rocksdb_stats_level")]
|
||||
pub rocksdb_stats_level: u8,
|
||||
|
||||
/// Erases data no longer reachable in the current schema. The developers
|
||||
/// expect this to be set to true which simplifies the schema and prevents
|
||||
/// accumulation of old schemas remaining in the codebase forever. If this
|
||||
/// is set to false, old columns which are not described in the current
|
||||
/// schema will be ignored rather than erased, leaking their space.
|
||||
///
|
||||
/// This can be set to false when moving between versions in ways which are
|
||||
/// not recommended or otherwise forbidden, or for diagnostic and
|
||||
/// development purposes; requiring preservation across such movements.
|
||||
///
|
||||
/// default: true
|
||||
#[serde(default = "true_fn")]
|
||||
pub rocksdb_drop_missing_columns: bool,
|
||||
|
||||
/// This is a password that can be configured that will let you login to the
|
||||
/// server bot account (currently `@conduit`) for emergency troubleshooting
|
||||
/// purposes such as recovering/recreating your admin room, or inviting
|
||||
|
||||
@@ -103,7 +103,10 @@ fn configure_cfds(
|
||||
debug!("Creating new column {name:?} not previously found in existing database.");
|
||||
});
|
||||
|
||||
let missing_descriptors = missing.clone().map(|_| descriptor::DROPPED);
|
||||
let missing_descriptors = missing
|
||||
.clone()
|
||||
.filter(|_| config.rocksdb_drop_missing_columns)
|
||||
.map(|_| descriptor::DROPPED);
|
||||
|
||||
let cfopts: Vec<_> = desc
|
||||
.iter()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#![type_length_limit = "3072"]
|
||||
#![type_length_limit = "8192"]
|
||||
|
||||
extern crate rust_rocksdb as rocksdb;
|
||||
|
||||
|
||||
@@ -1080,6 +1080,18 @@
|
||||
#
|
||||
#rocksdb_stats_level = 1
|
||||
|
||||
# Erases data no longer reachable in the current schema. The developers
|
||||
# expect this to be set to true which simplifies the schema and prevents
|
||||
# accumulation of old schemas remaining in the codebase forever. If this
|
||||
# is set to false, old columns which are not described in the current
|
||||
# schema will be ignored rather than erased, leaking their space.
|
||||
#
|
||||
# This can be set to false when moving between versions in ways which are
|
||||
# not recommended or otherwise forbidden, or for diagnostic and
|
||||
# development purposes; requiring preservation across such movements.
|
||||
#
|
||||
#rocksdb_drop_missing_columns = true
|
||||
|
||||
# This is a password that can be configured that will let you login to the
|
||||
# server bot account (currently `@conduit`) for emergency troubleshooting
|
||||
# purposes such as recovering/recreating your admin room, or inviting
|
||||
|
||||
Reference in New Issue
Block a user