Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

raft: persist Lead in HardState #124421

Closed
nvanbenschoten opened this issue May 20, 2024 · 1 comment · Fixed by #126898
Closed

raft: persist Lead in HardState #124421

nvanbenschoten opened this issue May 20, 2024 · 1 comment · Fixed by #126898
Assignees
Labels
A-kv-replication Relating to Raft, consensus, and coordination. A-leader-leases Related to the introduction of leader leases C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) T-kv KV Team

Comments

@nvanbenschoten
Copy link
Member

nvanbenschoten commented May 20, 2024

raft.lead is currently volatile state which is lost on restart. We should add this to HardState and make it durable. This will pair with the LeadEpoch field that we plan to add to HardState as part of the leader-lease project.

Related to #122446.

Jira issue: CRDB-38884

Epic CRDB-37522

@nvanbenschoten nvanbenschoten added C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) A-kv-replication Relating to Raft, consensus, and coordination. T-kv-replication labels May 20, 2024
Copy link

blathers-crl bot commented May 20, 2024

cc @cockroachdb/replication

@nvanbenschoten nvanbenschoten added the A-leader-leases Related to the introduction of leader leases label Jun 6, 2024
@exalate-issue-sync exalate-issue-sync bot added A-leader-leases Related to the introduction of leader leases and removed A-leader-leases Related to the introduction of leader leases labels Jun 6, 2024
arulajmani added a commit to arulajmani/cockroach that referenced this issue Jun 27, 2024
Previously, we were using raw uint64s everywhere to represent peer
IDs in raft. This patch strongly types them.

Informs: cockroachdb#124421

Release note: None
@exalate-issue-sync exalate-issue-sync bot added T-kv KV Team and removed T-kv-replication labels Jun 28, 2024
arulajmani added a commit to arulajmani/cockroach that referenced this issue Jun 28, 2024
Previously, we were using raw uint64s everywhere to represent peer
IDs in raft. This patch strongly types them.

Informs: cockroachdb#124421

Release note: None
arulajmani added a commit to arulajmani/cockroach that referenced this issue Jul 2, 2024
Previously, we were using raw uint64s everywhere to represent peer
IDs in raft. This patch strongly types them.

Informs: cockroachdb#124421

Release note: None
DarrylWong pushed a commit to DarrylWong/fork that referenced this issue Jul 2, 2024
Previously, we were using raw uint64s everywhere to represent peer
IDs in raft. This patch strongly types them.

Informs: cockroachdb#124421

Release note: None
arulajmani added a commit to arulajmani/cockroach that referenced this issue Jul 9, 2024
Previously, leader information for a given term was stored as volatile
state in raft. This change persists it durably by moving it to
HardState. This is done in service of leader leases, where we want to
ensure a follower doesn't violate its promise of support to the leader
even after a restart.

Fixes cockroachdb#124421

Release note: None
arulajmani added a commit to arulajmani/cockroach that referenced this issue Jul 12, 2024
Previously, leader information for a given term was stored as volatile
state in raft. This change persists it durably by moving it to
HardState. This is done in service of leader leases, where we want to
ensure a follower doesn't violate its promise of support to the leader
even after a restart.

Fixes cockroachdb#124421

Release note: None
craig bot pushed a commit that referenced this issue Jul 17, 2024
126898: raft: persist Lead into the HardState r=nvanbenschoten a=arulajmani

Previously, leader information for a given term was stored as volatile state in raft. This change persists it durably by moving it to HardState. This is done in service of leader leases, where we want to ensure a follower doesn't violate its promise of support to the leader even after a restart.

Fixes #124421

Release note: None

126970: sql/sem/tree, backupccl, *: sanitize URLs during Format r=dt,rytaft a=michae2

Prior to this change, all SQL statements containing URLs would be formatted with the full URL in cleartext, including any secrets such as keys or passwords. These secrets would sometimes show up in the slow query log or sql audit log. This PR adds new functions `tree.(*FmtCtx).FormatURI`and `tree.(*FmtCtx).FormatURIs` which are designed to sanitize URLs during formatting.

See individual commits for details.

Fixes: CRDB-39710, TREQ-284

Epic: None

Release note: None

Co-authored-by: Arul Ajmani <[email protected]>
Co-authored-by: Michael Erickson <[email protected]>
@craig craig bot closed this as completed in e60feee Jul 17, 2024
@github-project-automation github-project-automation bot moved this to Incoming in KV Aug 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-kv-replication Relating to Raft, consensus, and coordination. A-leader-leases Related to the introduction of leader leases C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) T-kv KV Team
Projects
No open projects
Status: Incoming
Development

Successfully merging a pull request may close this issue.

2 participants