Skip to content

Issue 6347 - better fix for desyncronized vlv cache #6358

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

Merged
merged 1 commit into from
Oct 10, 2024

Conversation

progier389
Copy link
Contributor

@progier389 progier389 commented Oct 9, 2024

A better fix than PR 6349 about corrupted vlv cache
Problem is a race condition because txn was released while building the cache.
Solution keep the write txn open until the cache is fully rebuilt.
Also fixed some debug logs
And also added the source of a tool useful to check the vlv cache consistency
Note: this remove PR #6349 and integrate PR #6356

Issue: #6347

Reviewed by @tbodaz (Thanks!)

Copy link
Contributor

@tbordaz tbordaz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only cosmetic points. LGTM

@@ -533,7 +549,7 @@ void dbmdb_log_dbi_set_fn(const char *file, int lineno, const char *funcname, co
Dl_info info = {0};
dladdr(fn, &info);
/* Cannot use dbi_str here because slot is not yet up2date (so dbname is an argument) */
dbg_log(file, lineno, funcname, DBGMDB_LEVEL_MDBAPI, "%s(txn=0x%p, dbi=%d <%s>, fn=0x%p <%s>)\n", action, txn, dbi, dbname, fn, info.dli_sname);
dbg_log(file, lineno, funcname, DBGMDB_LEVEL_MDBAPI, "%s(txn=0x%p, dbi=%d <%s>, fn=0x%p <%s>)\n", action, txn, dbi, dbname, fn, info.dli_sname);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not calling txn_loglvl() instead of DBGMDB_LEVEL_MDBAPI?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

txn_log() is used only for txn related function It allows to log when txn are open and closed when
DBGMDB_LEVEL_MDBAPI or DBGMDB_LEVEL_TXN is set but log txn backtrace only if DBGMDB_LEVEL_TXN is set

if (rc) {
break;
}
if (recno % RECNO_CACHE_INTERVAL == 1) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it good indentation here ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

@progier389 progier389 linked an issue Oct 10, 2024 that may be closed by this pull request
@progier389 progier389 merged commit 8366819 into 389ds:main Oct 10, 2024
197 checks passed
progier389 added a commit that referenced this pull request Oct 10, 2024
A better fix than PR 6349 about corrupted vlv cache
Problem is a race condition because txn was released while building the cache.
Solution keep the write txn open until the cache is fully rebuilt.
Also fixed some debug logs
And also added the source of a tool useful to check the vlv cache consistency
Note: this remove PR #6349 and integrate PR #6356

Issue: #6347

Reviewed by @tbodaz (Thanks!)

(cherry picked from commit 8366819)
progier389 added a commit that referenced this pull request Oct 11, 2024
A better fix than PR 6349 about corrupted vlv cache
Problem is a race condition because txn was released while building the cache.
Solution keep the write txn open until the cache is fully rebuilt.
Also fixed some debug logs
And also added the source of a tool useful to check the vlv cache consistency
Note: this remove PR #6349 and integrate PR #6356

Issue: #6347

Reviewed by @tbodaz (Thanks!)

(cherry picked from commit 8366819)
@progier389 progier389 deleted the i6347_v2 branch May 20, 2025 13:05
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

Successfully merging this pull request may close these issues.

VLV search sometime fails with operation error
2 participants