Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vacuum is not working as intended/documented (Version: 2.2.1) #5095

Open
MaestroLegato opened this issue Aug 10, 2024 · 0 comments
Open

Vacuum is not working as intended/documented (Version: 2.2.1) #5095

MaestroLegato opened this issue Aug 10, 2024 · 0 comments

Comments

@MaestroLegato
Copy link

Issue Description

The instructions on docs and some github discussions (+ couple of other places I don't remember) suggest vacuuming is performed by running rippled with --vacuum /path/to/temp/db flag. In reality, it looks like /path/to/temp/db is completely ignored in current codebase.

Steps to Reproduce

Run rippled with --vacuum /path/to/temp/db

Expected Result

VACUUM should use specified /path/to/temp/db to perform sqlite vacuuming.

Alternatively (if it was decided that supplying path as an argument is flaky) users should be instructed to set up SQLITE_TMPDIR environmental variable (or other instructions that work best for different environments). Maybe if it is not defined it should print out a message that "hey, sqlite is vacuuming using default setting, which is probably your system drive, specify SQLITE_TMPDIR to point it to correct location"

Actual Result

It ignores /path/to/temp/db and performs vacuuming with the default temp directory, for linux it is determined in this order (source):

  1. The directory set by PRAGMA temp_store_directory or by the sqlite3_temp_directory global variable
  2. The SQLITE_TMPDIR environment variable
  3. The TMPDIR environment variable
  4. /var/tmp
  5. /usr/tmp
  6. /tmp
  7. The current working directory (".")

Considering full history node - for most users who are not aware of that it would probably start vacuuming on a system drive and eventually run out of space, failing to vacuum.

For smaller nodes this might vacuum fine, but smaller nodes often don't even need to vacuum in the first place.

Environment

Ubuntu 22.04.4
rippled 2.2.1 (full history node)

Workaround

If anyone faces this issue right - you can just define SQLITE_TMPDIR before vacuuming

sudo -u rippled bash -c 'export SQLITE_TMPDIR=/mnt/md1/rippled_txdb_migration && /opt/ripple/bin/rippled -q --vacuum'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant