datastore: add tuning option for chunk order

currently, we sort chunks by inode when verifying or backing up to tape.
we get the inode# by stat'ing each chunk, which may be more expensive
than the gains of reading the chunks in order

Since that is highly dependent on the underlying storage of the datastore,
introduce a tuning option  so that the admin can tune that behaviour
for each datastore.

The default stays the same (sorting by inode)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak
2022-02-22 15:57:49 +01:00
committed by Dietmar Maurer
parent 118f8589a9
commit fef61684b4
3 changed files with 72 additions and 8 deletions

View File

@ -184,6 +184,8 @@ pub enum DeletableProperty {
notify_user,
/// Delete the notify property
notify,
/// Delete the tuning property
tuning,
}
#[api(
@ -250,6 +252,7 @@ pub fn update_datastore(
DeletableProperty::verify_new => { data.verify_new = None; },
DeletableProperty::notify => { data.notify = None; },
DeletableProperty::notify_user => { data.notify_user = None; },
DeletableProperty::tuning => { data.tuning = None; },
}
}
}
@ -295,6 +298,8 @@ pub fn update_datastore(
if update.notify_user.is_some() { data.notify_user = update.notify_user; }
if update.tuning.is_some() { data.tuning = update.tuning; }
config.set_data(&name, "datastore", &data)?;
pbs_config::datastore::save_config(&config)?;