Skip to content

Commit

Permalink
db: remove wal disabling / fast-and-loose option. (openethereum#8963)
Browse files Browse the repository at this point in the history
* parity: highlight --fast-and-loose is not recommended.

* parity: remove fast-and-loose option, ref openethereum#1765

* db: remove db wal from options, it's always enabled

* db: remove wal from rocksdb helpers

* cli: fix wallet import test

* ethcore: fix client config tests

* parity: proper deprecated handling for fast-and-loose

* ethcore-client: fix config

* parity: mark fast-and-loose removed

* parity: fix test_find_deprecated

* parity: fix type for fast-and-loose flag

* lock file
  • Loading branch information
5chdn authored and dvdplm committed Jul 10, 2018
1 parent 526c61e commit da5de4a
Show file tree
Hide file tree
Showing 16 changed files with 32 additions and 62 deletions.
28 changes: 14 additions & 14 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion ethcore/service/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,6 @@ mod tests {

client_db_config.memory_budget = client_config.db_cache_size;
client_db_config.compaction = CompactionProfile::auto(&client_path);
client_db_config.wal = client_config.db_wal;

let client_db_handler = test_helpers::restoration_db_handler(client_db_config.clone());
let client_db = client_db_handler.open(&client_path).unwrap();
Expand Down
3 changes: 0 additions & 3 deletions ethcore/src/client/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,6 @@ pub struct ClientConfig {
pub db_cache_size: Option<usize>,
/// State db compaction profile
pub db_compaction: DatabaseCompactionProfile,
/// Should db have WAL enabled?
pub db_wal: bool,
/// Operating mode
pub mode: Mode,
/// The chain spec name
Expand Down Expand Up @@ -137,7 +135,6 @@ impl Default for ClientConfig {
name: "default".into(),
db_cache_size: None,
db_compaction: Default::default(),
db_wal: true,
mode: Mode::Active,
spec_name: "".into(),
verifier_type: VerifierType::Canon,
Expand Down
11 changes: 1 addition & 10 deletions parity/blockchain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ pub struct ImportBlockchain {
pub pruning_history: u64,
pub pruning_memory: usize,
pub compaction: DatabaseCompactionProfile,
pub wal: bool,
pub tracing: Switch,
pub fat_db: Switch,
pub vm_type: VMType,
Expand All @@ -111,7 +110,6 @@ pub struct ExportBlockchain {
pub pruning_history: u64,
pub pruning_memory: usize,
pub compaction: DatabaseCompactionProfile,
pub wal: bool,
pub fat_db: Switch,
pub tracing: Switch,
pub from_block: BlockId,
Expand All @@ -130,7 +128,6 @@ pub struct ExportState {
pub pruning_history: u64,
pub pruning_memory: usize,
pub compaction: DatabaseCompactionProfile,
pub wal: bool,
pub fat_db: Switch,
pub tracing: Switch,
pub at: BlockId,
Expand Down Expand Up @@ -207,8 +204,7 @@ fn execute_import_light(cmd: ImportBlockchain) -> Result<(), String> {
// initialize database.
let db = db::open_db(&client_path.to_str().expect("DB path could not be converted to string."),
&cmd.cache_config,
&cmd.compaction,
cmd.wal).map_err(|e| format!("Failed to open database: {:?}", e))?;
&cmd.compaction).map_err(|e| format!("Failed to open database: {:?}", e))?;

// TODO: could epoch signals be avilable at the end of the file?
let fetch = ::light::client::fetch::unavailable();
Expand Down Expand Up @@ -351,7 +347,6 @@ fn execute_import(cmd: ImportBlockchain) -> Result<(), String> {
tracing,
fat_db,
cmd.compaction,
cmd.wal,
cmd.vm_type,
"".into(),
algorithm,
Expand Down Expand Up @@ -494,7 +489,6 @@ fn start_client(
tracing: Switch,
fat_db: Switch,
compaction: DatabaseCompactionProfile,
wal: bool,
cache_config: CacheConfig,
require_fat_db: bool,
) -> Result<ClientService, String> {
Expand Down Expand Up @@ -544,7 +538,6 @@ fn start_client(
tracing,
fat_db,
compaction,
wal,
VMType::default(),
"".into(),
algorithm,
Expand Down Expand Up @@ -586,7 +579,6 @@ fn execute_export(cmd: ExportBlockchain) -> Result<(), String> {
cmd.tracing,
cmd.fat_db,
cmd.compaction,
cmd.wal,
cmd.cache_config,
false,
)?;
Expand Down Expand Up @@ -631,7 +623,6 @@ fn execute_export_state(cmd: ExportState) -> Result<(), String> {
cmd.tracing,
cmd.fat_db,
cmd.compaction,
cmd.wal,
cmd.cache_config,
true
)?;
Expand Down
10 changes: 6 additions & 4 deletions parity/cli/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -814,10 +814,6 @@ usage! {
"Specify a filename into which logging should be appended.",

["Footprint Options"]
FLAG flag_fast_and_loose: (bool) = false, or |c: &Config| c.footprint.as_ref()?.fast_and_loose.clone(),
"--fast-and-loose",
"Disables DB WAL, which gives a significant speed up but means an unclean exit is unrecoverable.",

FLAG flag_scale_verifiers: (bool) = false, or |c: &Config| c.footprint.as_ref()?.scale_verifiers.clone(),
"--scale-verifiers",
"Automatically scale amount of verifier threads based on workload. Not guaranteed to be faster.",
Expand Down Expand Up @@ -967,6 +963,12 @@ usage! {
"--ui-no-validation",
"Does nothing; UI is now a separate project.",

// FLAG Removed in 2.0.

FLAG flag_fast_and_loose: (bool) = false, or |_| None,
"--fast-and-loose",
"Does nothing; DB WAL is always activated.",

// ARG Removed in 1.6 or before.

ARG arg_etherbase: (Option<String>) = None, or |_| None,
Expand Down
1 change: 0 additions & 1 deletion parity/cli/tests/config.full.toml
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ cache_size_blocks = 8
cache_size_queue = 50
cache_size_state = 25
cache_size = 128 # Overrides above caches with total size
fast_and_loose = false
db_compaction = "ssd"
fat_db = "auto"
scale_verifiers = true
Expand Down
13 changes: 0 additions & 13 deletions parity/configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ impl Configuration {
let tracing = self.args.arg_tracing.parse()?;
let fat_db = self.args.arg_fat_db.parse()?;
let compaction = self.args.arg_db_compaction.parse()?;
let wal = !self.args.flag_fast_and_loose;
let warp_sync = !self.args.flag_no_warp;
let geth_compatibility = self.args.flag_geth;
let dapps_conf = self.dapps_config();
Expand Down Expand Up @@ -236,7 +235,6 @@ impl Configuration {
pruning_history: pruning_history,
pruning_memory: self.args.arg_pruning_memory,
compaction: compaction,
wal: wal,
tracing: tracing,
fat_db: fat_db,
vm_type: vm_type,
Expand All @@ -258,7 +256,6 @@ impl Configuration {
pruning_history: pruning_history,
pruning_memory: self.args.arg_pruning_memory,
compaction: compaction,
wal: wal,
tracing: tracing,
fat_db: fat_db,
from_block: to_block_id(&self.args.arg_export_blocks_from)?,
Expand All @@ -277,7 +274,6 @@ impl Configuration {
pruning_history: pruning_history,
pruning_memory: self.args.arg_pruning_memory,
compaction: compaction,
wal: wal,
tracing: tracing,
fat_db: fat_db,
at: to_block_id(&self.args.arg_export_state_at)?,
Expand All @@ -302,7 +298,6 @@ impl Configuration {
fat_db: fat_db,
compaction: compaction,
file_path: self.args.arg_snapshot_file.clone(),
wal: wal,
kind: snapshot::Kind::Take,
block_at: to_block_id(&self.args.arg_snapshot_at)?,
};
Expand All @@ -319,7 +314,6 @@ impl Configuration {
fat_db: fat_db,
compaction: compaction,
file_path: self.args.arg_restore_file.clone(),
wal: wal,
kind: snapshot::Kind::Restore,
block_at: to_block_id("latest")?, // unimportant.
};
Expand All @@ -331,7 +325,6 @@ impl Configuration {
spec: spec,
pruning: pruning,
compaction: compaction,
wal: wal,
};
Cmd::ExportHardcodedSync(export_hs_cmd)
} else {
Expand Down Expand Up @@ -372,7 +365,6 @@ impl Configuration {
tracing: tracing,
fat_db: fat_db,
compaction: compaction,
wal: wal,
vm_type: vm_type,
warp_sync: warp_sync,
warp_barrier: self.args.arg_warp_barrier,
Expand Down Expand Up @@ -1281,7 +1273,6 @@ mod tests {
pruning_history: 64,
pruning_memory: 32,
compaction: Default::default(),
wal: true,
tracing: Default::default(),
fat_db: Default::default(),
vm_type: VMType::Interpreter,
Expand All @@ -1306,7 +1297,6 @@ mod tests {
pruning_memory: 32,
format: Default::default(),
compaction: Default::default(),
wal: true,
tracing: Default::default(),
fat_db: Default::default(),
from_block: BlockId::Number(1),
Expand All @@ -1329,7 +1319,6 @@ mod tests {
pruning_memory: 32,
format: Default::default(),
compaction: Default::default(),
wal: true,
tracing: Default::default(),
fat_db: Default::default(),
at: BlockId::Latest,
Expand All @@ -1354,7 +1343,6 @@ mod tests {
pruning_memory: 32,
format: Some(DataFormat::Hex),
compaction: Default::default(),
wal: true,
tracing: Default::default(),
fat_db: Default::default(),
from_block: BlockId::Number(1),
Expand Down Expand Up @@ -1442,7 +1430,6 @@ mod tests {
mode: Default::default(),
tracing: Default::default(),
compaction: Default::default(),
wal: true,
vm_type: Default::default(),
geth_compatibility: false,
net_settings: Default::default(),
Expand Down
1 change: 0 additions & 1 deletion parity/db/rocksdb/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ pub fn client_db_config(client_path: &Path, client_config: &ClientConfig) -> Dat

client_db_config.memory_budget = client_config.db_cache_size;
client_db_config.compaction = compaction_profile(&client_config.db_compaction, &client_path);
client_db_config.wal = client_config.db_wal;

client_db_config
}
1 change: 0 additions & 1 deletion parity/db/rocksdb/migration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,6 @@ pub fn migrate(path: &Path, compaction_profile: &DatabaseCompactionProfile) -> R
memory_budget: None,
compaction: compaction_profile,
columns: db::NUM_COLUMNS,
wal: true,
};

migrate_blooms(&db_path, &db_config).map_err(Error::BloomsDB)?;
Expand Down
3 changes: 1 addition & 2 deletions parity/db/rocksdb/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,12 @@ pub fn restoration_db_handler(client_path: &Path, client_config: &ClientConfig)
}

/// Open a new main DB.
pub fn open_db(client_path: &str, cache_config: &CacheConfig, compaction: &DatabaseCompactionProfile, wal: bool) -> io::Result<Arc<BlockChainDB>> {
pub fn open_db(client_path: &str, cache_config: &CacheConfig, compaction: &DatabaseCompactionProfile) -> io::Result<Arc<BlockChainDB>> {
let path = Path::new(client_path);

let db_config = DatabaseConfig {
memory_budget: Some(cache_config.blockchain() as usize * 1024 * 1024),
compaction: helpers::compaction_profile(&compaction, path),
wal,
.. DatabaseConfig::with_columns(NUM_COLUMNS)
};

Expand Down
Loading

0 comments on commit da5de4a

Please sign in to comment.