Skip to content

Commit

Permalink
Overhaul filesystem store to no longer use renameat2
Browse files Browse the repository at this point in the history
This PR introduces a massive overhaul to remove the dependency on
renameat2 as well as fix bugs in the process. The bugs found are:
* unref() was not being called when insert() replaced an item
* Various extremely unlikely corner cases around files being
  created, replaced, deleted
* Edge case where the contents of a FileEntry could use the wrong
  data on data replacement (although very unlikely).

The paradigm of "FileEntry" entries and it's corresponding file
are now full immutable, meaning if the file gets replaced it
will generate a new FileEntry and shuffle the files around so both
may be read uninterrupted at any point.

fixes: 106
  • Loading branch information
allada committed Jun 28, 2023
1 parent 1994dde commit a3cddf9
Show file tree
Hide file tree
Showing 7 changed files with 591 additions and 223 deletions.
3 changes: 3 additions & 0 deletions cas/store/BUILD
Expand Up @@ -216,6 +216,7 @@ rust_library(
srcs = ["filesystem_store.rs"],
deps = [
"//config",
"//third_party:async_lock",
"//third_party:bytes",
"//third_party:filetime",
"//third_party:futures",
Expand Down Expand Up @@ -395,6 +396,8 @@ rust_test(
deps = [
"//config",
"//third_party:filetime",
"//third_party:futures",
"//third_party:lazy_static",
"//third_party:pretty_assertions",
"//third_party:rand",
"//third_party:tokio",
Expand Down

0 comments on commit a3cddf9

Please sign in to comment.