Giter Club home page Giter Club logo

Comments (3)

yaleman avatar yaleman commented on June 9, 2024

It's already documented that you need to vacuum after changing the db_fs_type, but I've added a PR to note it on the config entry ref too.

from kanidm.

TheRealGramdalf avatar TheRealGramdalf commented on June 9, 2024

I did see that, but that's not the part I'm worried about - it says that "It is not possible to change the page_size after entering WAL mode, either on an empty database or by using VACUUM"

Unless I'm horribly incorrect, this means that once created (and WAL mode is enabled, which I assume is the case due to the .db-wal file), you cannot change the page size with a vacuum.

The only exception that I can see (though I am no expert in sql) is "You must be in a rollback journal mode to change the page size."

from kanidm.

yaleman avatar yaleman commented on June 9, 2024

And that's why we disable the WAL mode journalling on vacuum. ref

vconn
.pragma_update(None, "journal_mode", "DELETE")
.map_err(|e| {
admin_error!(?e, "rusqlite journal_mode update error");
OperationError::SqliteError
})?;
vconn.close().map_err(|e| {
admin_error!(?e, "rusqlite db close error");
OperationError::SqliteError
})?;
let vconn =
Connection::open_with_flags(cfg.path.as_str(), flags).map_err(sqlite_error)?;
vconn
.pragma_update(None, "page_size", cfg.fstype as u32)
.map_err(|e| {
admin_error!(?e, "rusqlite page_size update error");
OperationError::SqliteError
})?;
vconn.execute_batch("VACUUM").map_err(|e| {
admin_error!(?e, "rusqlite vacuum error");
OperationError::SqliteError
})?;
vconn
.pragma_update(None, "journal_mode", "WAL")
.map_err(|e| {
admin_error!(?e, "rusqlite journal_mode update error");
OperationError::SqliteError
})?;

from kanidm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.