-
Notifications
You must be signed in to change notification settings - Fork 85
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
Database access mode #2089
Database access mode #2089
Conversation
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.
Did a pre-review while this is still a draft. please check my comments.
There are still some code not cleaned up. Let me know when it is ready for another review.
src/include/common/file_utils.h
Outdated
@@ -15,6 +15,24 @@ | |||
namespace kuzu { | |||
namespace common { | |||
|
|||
enum class FileLockType : uint8_t { NO_LOCK = 0, READ_LOCK = 1, WRITE_LOCK = 2 }; | |||
|
|||
class FileFlags { |
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.
This class should be cleaned after you merge locking logic into existing openFile
function.
6ba2181
to
70223a4
Compare
Codecov ReportAll modified lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2089 +/- ##
==========================================
+ Coverage 89.55% 89.58% +0.02%
==========================================
Files 1007 1006 -1
Lines 36250 36273 +23
==========================================
+ Hits 32465 32496 +31
+ Misses 3785 3777 -8
☔ View full report in Codecov by Sentry. |
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.
Didn't look into tests yet. Will continue later.
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.
Didn't look into tests yet. Will continue later when you finalize changes to tests.
f5554d9
to
ccbcab0
Compare
376f252
to
4762664
Compare
3d30627
to
3660a9c
Compare
3660a9c
to
392d4a9
Compare
This PR is aimed at solving issue #921 on non-Windows platforms.
Steps:
.lock
in each database directory. Use this file to check the status of the database.READ_ONLY
orREAD_WRITE
(note I useREAD_WRITE
when the access mode is not specified), lock the.lock
using the functionfcntl
.Limitation
fcntl
can only solve the read-write lock during different processes. So we cannot solve the read-write lock in the same process.