Skip to content
This repository has been archived by the owner on Mar 4, 2024. It is now read-only.

Add getters for a few additional bits of state #311

Closed
wants to merge 1 commit into from

Conversation

cole-miller
Copy link
Contributor

These are used by canonical/dqlite#402 -- see that PR for motivation.

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

Signed-off-by: Cole Miller <cole.miller@canonical.com>
@cole-miller cole-miller changed the title state: Add getters for a few additional bits of state Add getters for a few additional bits of state Sep 15, 2022
@codecov-commenter
Copy link

codecov-commenter commented Sep 15, 2022

Codecov Report

Merging #311 (8edc59b) into master (e1e6fc7) will decrease coverage by 0.04%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##           master     #311      +/-   ##
==========================================
- Coverage   83.49%   83.44%   -0.05%     
==========================================
  Files          49       49              
  Lines        9280     9286       +6     
  Branches     2481     2481              
==========================================
+ Hits         7748     7749       +1     
- Misses        974      981       +7     
+ Partials      558      556       -2     
Impacted Files Coverage Δ
src/state.c 43.33% <0.00%> (-10.84%) ⬇️
src/uv_writer.c 77.44% <0.00%> (ø)
src/uv_prepare.c 85.02% <0.00%> (+0.59%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@freeekanayaka
Copy link
Contributor

At first sight it feels we're starting to require too much care from the client, which should probably not be concerned with these details.

I don't have a better solution right now, but I'll try to think a bit about it, including the possibility of unconditionally running the barrier at leader election as you originally implemented. This configuration issue is something I hadn't think of.

@cole-miller
Copy link
Contributor Author

A couple of alternatives:

  • Expose a single function raft_needs_config_barrier (or some other name) that just checks the condition given in the other PR (there is an uncommitted config change and the last log entry is not from the current term).
  • Have raft run the barrier itself when a config change is requested and that condition holds.

@cole-miller
Copy link
Contributor Author

Closing as no longer needed, see #302 (comment)

@cole-miller cole-miller closed this Dec 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants