lieuwex / LirsFS

MIT License
0 stars 0 forks source link

Implement FileRegistry (FR) #1

Closed sholtrop closed 1 year ago

sholtrop commented 1 year ago

Overview of all the files in the filesystem, consistently replicated through Raft on every node. It contains, per file:

Implement in Sqlite.

lieuwex commented 1 year ago

observations while thinking about implementing this:

  1. we have to keep in mind file/path revisions, if I create a, change it, remove it, and create a new file a we should be able to determine that the last a has nothing to do with the first a, every step has to be a revision. Do we want this file-based or global? Do we want revisions at all, or can we determine this by the serial number of the raft request?
  2. storing the keepers in a Create event is maybe not the best course of action, replication_factor should be good, and then we can have different events for "storage events". After replaying the raft log you get the keepers per file, of course. But log-wise seperating these seems logical. In case of node failure, we have to relocate the files, which would lead to a nice separate relocation event. The create event can have the destination nodes inscribed to them for initial storage nodes, yes, but I don't see the reason why this is useful.
  3. let's do SHA512 hash? is u64.
sholtrop commented 1 year ago
  1. Every operation on the FR is guaranteed by Raft to be replicated across all nodes. If you do these steps, they will be seen and performed by every node in the same order. So their FRs will be the same. Given this, why would we need to keep any other information regarding files?

  2. Agreed, let's split Create and Store events

  3. Sounds good

sholtrop commented 1 year ago

Blockers:

  1. Cannot get query! macro to deduce types, currently returns () for querying a single file from the the files table.
  2. The project not compiling yet makes this hard. Will work on #7 first.
lieuwex commented 1 year ago

@sholtrop done?

sholtrop commented 1 year ago

I'll mark this as done for now and do the rest of the NodeToNodeOperation as separate items