-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix RO sync: clear LRU for all log updates
- Loading branch information
Showing
3 changed files
with
29 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
(test (name issue398) (modules issue398) (libraries index index.unix)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
(* See https://github.com/mirage/index/issues/398 *) | ||
|
||
module L = struct | ||
let length = 4 | ||
end | ||
|
||
module I = | ||
Index_unix.Make | ||
(Index.Key.String_fixed (L)) (Index.Value.String_fixed (L)) | ||
(Index.Cache.Noop) | ||
|
||
let () = | ||
let path = "issue398.index" in | ||
let t = I.v path ~log_size:16384 in | ||
let ro = I.v path ~readonly:true ~log_size:16384 in | ||
I.replace t "1234" "aaaa"; | ||
I.flush t; | ||
I.sync ro; | ||
assert (I.find ro "1234" = "aaaa"); | ||
I.replace t "1234" "aaab"; | ||
I.flush t; | ||
I.sync ro; | ||
assert (I.find ro "1234" = "aaab") |