Skip to content

Issue 6347 - better fix for desyncronized vlv cache#6358

Merged
progier389 merged 1 commit into389ds:mainfrom
progier389:i6347_v2
Oct 10, 2024
Merged

Issue 6347 - better fix for desyncronized vlv cache#6358
progier389 merged 1 commit into389ds:mainfrom
progier389:i6347_v2

Conversation

@progier389
Copy link
Copy Markdown
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
Copy Markdown
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

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
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