-
Notifications
You must be signed in to change notification settings - Fork 20
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
index: release the merge lock if a merge raises an exception #312
index: release the merge lock if a merge raises an exception #312
Conversation
3e73ade
to
3fd6edd
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.
LGTM - there are probably more code simplification that can be done, but that's not critical
3fd6edd
to
1bd7437
Compare
5581c86
to
c1a7cf5
Compare
Rebased. |
match t.index with | ||
| None -> Tbl.length log.mem | ||
| Some index -> | ||
(Int63.to_int (IO.offset index.io) / Entry.encoded_size) |
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 is broken in 32 bit but we probably do not care :-)
LGTM |
Fixes the bug spotted here: mirage#312 (comment). I think `Int63.to_int` is a little too tempting from an API perspective, so I've shadowed it and provided more clearly named checked and unchecked alternatives.
Fixes the bug spotted here: mirage#312 (comment). I think `Int63.to_int` is a little too tempting from an API perspective, so I've shadowed it and provided more clearly named checked and unchecked alternatives.
CHANGES: ## Fixed - Reduce allocations during merge (mirage/index#274, mirage/index#277) - Protect concurrent syncs with a lock (mirage/index#309) - Fixed a performance issue for `Index.sync` when there is a blocking merge in progress: the `log_async` file was not cached properly and fully reloaded from disk every time. (mirage/index#310) - Release the merge lock if a merge raises an exception (mirage/index#312) - Added fsync after `Index.clear` to signal more quickly to read-only instances than something has changed in the file (mirage/index#308) ## Changed - Specialise `IO.v` to create read-only or read-write instances. (mirage/index#291) - `clear` removes the files on disks and opens new ones containing only the header. (mirage/index#288, mirage/index#307, mirage/index#317)
CHANGES: ## Fixed - Reduce allocations during merge (mirage/index#274, mirage/index#277) - Protect concurrent syncs with a lock (mirage/index#309) - Fixed a performance issue for `Index.sync` when there is a blocking merge in progress: the `log_async` file was not cached properly and fully reloaded from disk every time. (mirage/index#310) - Release the merge lock if a merge raises an exception (mirage/index#312) - Added fsync after `Index.clear` to signal more quickly to read-only instances than something has changed in the file (mirage/index#308) ## Changed - Specialise `IO.v` to create read-only or read-write instances. (mirage/index#291) - `clear` removes the files on disks and opens new ones containing only the header. (mirage/index#288, mirage/index#307, mirage/index#317)
CHANGES: ## Fixed - Reduce allocations during merge (mirage/index#274, mirage/index#277) - Protect concurrent syncs with a lock (mirage/index#309) - Fixed a performance issue for `Index.sync` when there is a blocking merge in progress: the `log_async` file was not cached properly and fully reloaded from disk every time. (mirage/index#310) - Release the merge lock if a merge raises an exception (mirage/index#312) - Added fsync after `Index.clear` to signal more quickly to read-only instances than something has changed in the file (mirage/index#308) ## Changed - Specialise `IO.v` to create read-only or read-write instances. (mirage/index#291) - `clear` removes the files on disks and opens new ones containing only the header. (mirage/index#288, mirage/index#307, mirage/index#317)
CHANGES: - Reduce allocations during merge (mirage/index#274, mirage/index#277) - Protect concurrent syncs with a lock (mirage/index#309) - Fixed a performance issue for `Index.sync` when there is a blocking merge in progress: the `log_async` file was not cached properly and fully reloaded from disk every time. (mirage/index#310) - Release the merge lock if a merge raises an exception (mirage/index#312) - Added fsync after `Index.clear` to signal more quickly to read-only instances than something has changed in the file (mirage/index#308) - Specialise `IO.v` to create read-only or read-write instances. (mirage/index#291) - `clear` removes the files on disks and opens new ones containing only the header. (mirage/index#288, mirage/index#307, mirage/index#317)
Fixes the bug spotted here: mirage#312 (comment). I think `Int63.to_int` is a little too tempting from an API perspective, so I've shadowed it and provided more clearly named checked and unchecked alternatives.
This has no effect on passing tests, but causes failing ones to behave more sensibly in the short term. A more complete solution would fix #284 entirely.