-
Notifications
You must be signed in to change notification settings - Fork 60
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
Read-only database opening does not work on a read-only context #176
Read-only database opening does not work on a read-only context #176
Conversation
0d7fd92
to
214c5dc
Compare
(rebased against main) |
Hello, if you want to discuss it I am on element (preferred) or discord. :) |
Hey @darnuria 👋 I will not have much time to help on this, but if you want more direct messages you can create a thread in #discussion of the Meilisearch Discord channel 😊 |
Hello, no problem! But it's a major blocker for release of 0.20.x since the EDIT: Not in a rush take time ! :D |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @darnuria 👋
Thank you for this PR. However, could you make the tests only run on the UNIX machines and add documentation on the RoTxn::commit
method to make its utility explicit (and check English quality, before submitting 😅)?
About the test (on my computer) it's quite complicated got multiprocess-deadlock since So I should force one-thread testing, fun that it passed CI! the
Maybe just documentation about the
The more 'ideal' solution would be to add examples to CI like suggest in #146 and check return code to have "read-world-complex test" but it also-show an issue with the current design in the case of a process-fork and share locks. |
Is it related to this part of the documentation, and can we do anything about it apart from documenting it? |
be032ca
to
2161650
Compare
770d52d
to
05e1734
Compare
Should be ok, force-pushed some typo and clippy. |
Yeah found a way to make the test relying on the same process space! It needs to be the only one having an Edit: Removed the paste, I found a way to test what happens if open_database is not commited |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for PR. I noticed some little English mistakes and a test to change a little bit 👌
6c46e4d
to
f69d8fc
Compare
Opening of databases with Env::open_database() without previous Env in memory with a RoTxn lead to the following error: `Io(Os { code: 22, kind: InvalidInput, message: "Invalid argument" })` It's due to the fact that RoTxn are not commited so the env->me_numdbs cannot be updated and will be set to CORE_DB so 2. It can trigger from multi-process setup, read-only opening, closing write access, and re-opening from the same process. Thanks to @Kerollmops for the typo and review. Co-authored-by: Clément Renault <[email protected]>
f69d8fc
to
e035849
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you infinitely for your help on that and the documentation addition 😍
This pull-request purpose a non-regrettion+functional test for opening read_only databases and fix.
The issue was already fixed in #10 but regressed in c40afad6bbd223832a2f86c38702313beb78366bd30bbfcd6d014e8cc651dafe L30-L39
EDIT: edited PR to only describe the fix+test made a separate issue #183