canonical / dqlite

Embeddable, replicated and fault-tolerant SQL engine.
https://dqlite.io
Other
3.85k stars 216 forks source link

Refactor vfs2 #631

Closed cole-miller closed 5 months ago

cole-miller commented 6 months ago

The headline change is that almost everything now lives in the linked-list entry, but various other changes were swept up in this as well.

Still incomplete, the state machine needs to be updated along with the implementations of the vfs2.h functions and quite a few smaller TODOs that I've tried to note in the code for my own benefit.

The big refactor was motivated by thinking in more detail about how the WAL-index is going to be managed throughout the node's whole lifetime, including the "follower" part that I'd previously neglected. I think I now have a good mental model for this, which I intend to write down as a doc comment on the state machine stuff once that is brought up to date/stabilized.

Signed-off-by: Cole Miller cole.miller@canonical.com

codecov[bot] commented 6 months ago

Codecov Report

Attention: Patch coverage is 57.90139% with 333 lines in your changes are missing coverage. Please review.

Project coverage is 80.56%. Comparing base (ae7a727) to head (4d74efa). Report is 12 commits behind head on dqlite-next.

Files Patch % Lines
src/vfs2.c 56.14% 271 Missing and 61 partials :warning:
src/utils.h 50.00% 0 Missing and 1 partial :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## dqlite-next #631 +/- ## =============================================== - Coverage 81.15% 80.56% -0.60% =============================================== Files 194 196 +2 Lines 28045 28300 +255 Branches 5211 5297 +86 =============================================== + Hits 22761 22799 +38 - Misses 3586 3808 +222 + Partials 1698 1693 -5 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

cole-miller commented 6 months ago

@just-now I would like to merge this into dqlite-next and follow up with additional tests/fixes in future, smaller PRs.