canonical / dqlite

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

Add local_data and is_local to raft_entry #639

Closed cole-miller closed 1 month ago

cole-miller commented 2 months ago

The local_data field stores data that is persisted locally (and stored in the in-memory log) but not send in AppendEntries messages. This will be used to store the vfs2_wal_slice when we introduce vfs2.

The is_local field is not persisted nor sent in AppendEntries. It exists only in the in-memory log and is true when the entry in question originated on the current node when it was leader, as opposed to being loaded from disk or received in AppendEntries. This will be used during vfs2 integration to determine whether to use vfs2_unhide or vfs2_commit when a COMMAND entry is applied.

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

cole-miller commented 2 months ago

This change breaks compatibility with all extant libraft releases, so as part of the same PR we need to disable the "external libraft" CI job and remove the option from the build system bits of it will need to be guarded by DQLITE_NEXT.

cole-miller commented 2 months ago

Marking as draft while I resolve the reports from ASan (which I wasn't seeing locally...)

cole-miller commented 2 months ago

Failing tests on Jammy are due to https://github.com/microsoft/linux-package-repositories/issues/130.

codecov[bot] commented 2 months ago

Codecov Report

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

Project coverage is 77.43%. Comparing base (cb65db7) to head (960b9e2). Report is 5 commits behind head on master.

Files Patch % Lines
src/raft/uv_encoding.c 81.48% 2 Missing and 3 partials :warning:
src/raft/uv_segment.c 84.21% 1 Missing and 2 partials :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #639 +/- ## ========================================== - Coverage 80.57% 77.43% -3.14% ========================================== Files 196 196 Lines 28301 27262 -1039 Branches 5300 5476 +176 ========================================== - Hits 22803 21110 -1693 - Misses 3767 4355 +588 - Partials 1731 1797 +66 ```

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

cole-miller commented 2 months ago

Marking this as draft until #642 merges and it can be retargeted to master