Skip to content

Issue 6356 - On LMDB, after an update the impact VLV index, the vlv r…#6357

Merged
tbordaz merged 1 commit into
389ds:mainfrom
tbordaz:issue_6356
Oct 9, 2024
Merged

Issue 6356 - On LMDB, after an update the impact VLV index, the vlv r…#6357
tbordaz merged 1 commit into
389ds:mainfrom
tbordaz:issue_6356

Conversation

@tbordaz

@tbordaz tbordaz commented Oct 8, 2024

Copy link
Copy Markdown
Contributor

…ecno cache is not systematically cleared

Bug description:
The VLV manages/uses an index database.
In LMDB in addition to the index there is one 'recno cache' database per VLV index.
This recno cache, related to a given VLV index, is cleared when an update impacts the VLV index.
The recno cache is not systematically cleared upon update of the VLV index.

The way to clear the cache is to delete the record with key "OK".
When the 'recno cache' does not contain this key, the next
lookup to the cache, clears all entries and rebuild the cache
from the vlv index.
The deletion is done with mdb_del with both KEY and DATA
refering to the same mdb_val. This means it deletes the records
matching if both KEY/DATA.
It should not match the DATA as the "OK" record is just
a flag and all entries with that key should be removed.

Fix description:
The fix consist to call mdb_del only with key

fixes: #6356

Reviewed by:

@progier389

Copy link
Copy Markdown
Contributor

Have you tried the fix ?
I am a bit surprised because as far as I know the data associated with OK key is always OK so
IMHO this change does nothing ...

dbscan -f ./~recno-cache/vlv#allcertspkitomcatindex.db -A
...
KEY: OK	DATA: OK
...

@progier389

Copy link
Copy Markdown
Contributor

Maybe you get tricked by #6349 that work around the issue ..

@progier389 progier389 left a comment

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.

Apparently, for some unknown reason, the change modify the behavior.
And since there is nothing wrong with deleting any record with "OK" key, lets accept this change

…ecno cache is not systematically cleared

Bug description:
	The VLV manages/uses an index database.
	In LMDB in addition to the index there is one 'recno cache' database per VLV index.
	This recno cache, related to a given VLV index, is cleared when an update impacts the VLV index.
	The recno cache is not systematically cleared upon update of the VLV index.

	The way to clear the cache is to delete the record with key "OK".
	When the 'recno cache' does not contain this key, the next
	lookup to the cache, clears all entries and rebuild the cache
	from the vlv index.
	The deletion is done with mdb_del with both KEY and DATA
	refering to the same mdb_val. This means it deletes the records
	matching if both KEY/DATA.
	It should not match the DATA as the "OK" record is just
	a flag and all entries with that key should be removed.

Fix description:
	The fix consist to call mdb_del only with key

fixes: 389ds#6356

Reviewed by: Pierre Rogier (Thanks!!)
@tbordaz tbordaz merged commit 145e7f4 into 389ds:main Oct 9, 2024
tbordaz added a commit that referenced this pull request Oct 10, 2024
…ecno cache is not systematically cleared (#6357)

Bug description:
	The VLV manages/uses an index database.
	In LMDB in addition to the index there is one 'recno cache' database per VLV index.
	This recno cache, related to a given VLV index, is cleared when an update impacts the VLV index.
	The recno cache is not systematically cleared upon update of the VLV index.

	The way to clear the cache is to delete the record with key "OK".
	When the 'recno cache' does not contain this key, the next
	lookup to the cache, clears all entries and rebuild the cache
	from the vlv index.
	The deletion is done with mdb_del with both KEY and DATA
	refering to the same mdb_val. This means it deletes the records
	matching if both KEY/DATA.
	It should not match the DATA as the "OK" record is just
	a flag and all entries with that key should be removed.

Fix description:
	The fix consist to call mdb_del only with key

fixes: #6356

Reviewed by: Pierre Rogier (Thanks!!)
tbordaz added a commit that referenced this pull request Oct 10, 2024
…ecno cache is not systematically cleared (#6357)

Bug description:
	The VLV manages/uses an index database.
	In LMDB in addition to the index there is one 'recno cache' database per VLV index.
	This recno cache, related to a given VLV index, is cleared when an update impacts the VLV index.
	The recno cache is not systematically cleared upon update of the VLV index.

	The way to clear the cache is to delete the record with key "OK".
	When the 'recno cache' does not contain this key, the next
	lookup to the cache, clears all entries and rebuild the cache
	from the vlv index.
	The deletion is done with mdb_del with both KEY and DATA
	refering to the same mdb_val. This means it deletes the records
	matching if both KEY/DATA.
	It should not match the DATA as the "OK" record is just
	a flag and all entries with that key should be removed.

Fix description:
	The fix consist to call mdb_del only with key

fixes: #6356

Reviewed by: Pierre Rogier (Thanks!!)
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.

On LMDB, after an update the impact VLV index, the vlv recno cache is not systematically cleared

2 participants