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

LMDB dumps the entire db if running with debug logging #5259

Open
nguyenm100 opened this issue Feb 26, 2025 · 7 comments
Open

LMDB dumps the entire db if running with debug logging #5259

nguyenm100 opened this issue Feb 26, 2025 · 7 comments
Labels
🐞 bug issue is a bug

Comments

@nguyenm100
Copy link
Contributor

Current Behavior

looks like lmdb dumps the entire valuestore if debug logging is enabled on startup. this becomes an issue for running against any decently size db.

https://github.com/eclipse-rdf4j/rdf4j/blob/main/core/sail/lmdb/src/main/java/org/eclipse/rdf4j/sail/lmdb/ValueStore.java#L243

Expected Behavior

dump should either be removed or put under TRACE

Steps To Reproduce

  1. set logging to DEBUG
  2. select from an lmdb store

Version

5.0.3

Are you interested in contributing a solution yourself?

None

Anything else?

No response

@nguyenm100 nguyenm100 added the 🐞 bug issue is a bug label Feb 26, 2025
@nguyenm100
Copy link
Contributor Author

nguyenm100 commented Feb 26, 2025

@kenwenzel we can make the fix. let us know whether we should remove or put under TRACE (or other option). tx

@kenwenzel
Copy link
Contributor

I think this was introduced by @hmottestad to fix some errors.
I would propose to remove the logging as it is problematic with large dbs.

@nguyenm100
Copy link
Contributor Author

should we remove the whole if (logger.isDebugEnabled()) {} block?

@kenwenzel
Copy link
Contributor

I'm actually a bit puzzled why the logic for gc is triggered inside the block and not outside before checking the log level. I'll have to take a look If this is intended or just an error.

@kenwenzel
Copy link
Contributor

kenwenzel commented Feb 27, 2025

I propose something alonog the following lines:

// trigger deletion of values marked for GC
startTransaction(true);
commit();

if (LOG_VALUES_ON_STARTUP) {
	// print current values in store
	logValues();
}

The initial transaction needs to be moved outside the if condition to evict unused values on startup.

@nguyenm100
Copy link
Contributor Author

does it make sense to log the values via an external tool or log just the first X values (x=1000 or something) when logging is on trace? the other thought is to disable debug/trace for this function in logback.xml as the default and anyone that needs it can turn it on there?

though how useful is this function beyond people debugging a specific problem in lmdb thus they could always manually enable it locally.

@kenwenzel
Copy link
Contributor

A good approach could be to just add a main method to the ValueStore that can be used to log the values and completely remove the logging from the constructor. I'm not sure if RDF4J already depends on picocli or something to ease the handling if command line arguments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug issue is a bug
Projects
None yet
Development

No branches or pull requests

2 participants