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

Dont mark entry as done in Oracle map if we didn't propose it yet. #2274

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions worker/groups.go
Original file line number Diff line number Diff line change
Expand Up @@ -646,19 +646,24 @@ func (g *groupi) proposeDelta(oracleDelta *intern.OracleDelta) {
if !g.Node.AmLeader() {
return
}
// TODO (pawan) - All servers open a stream with Zero and processDelta. Why do we still have to
// propose these updates then?

// Only the leader of a group proposes the commit proposal for a group after getting delta from
// Zero.
for startTs, commitTs := range oracleDelta.Commits {
// The leader might not have yet applied the mutation and hence may not have the txn in the
// map. Its ok we can just continue, processOracleDeltaStream checks the oracle map every
// minute and calls proposeDelta.
if posting.Txns().Get(startTs) == nil {
posting.Oracle().Done(startTs)
// Don't mark oracle as done here as then it would be deleted the entry from map and it
// won't be proposed to the group. This could eventually block snapshots from happening
// in a replicated cluster.
continue
}
tctx := &api.TxnContext{StartTs: startTs, CommitTs: commitTs}
go g.Node.proposeAndWait(context.Background(), &intern.Proposal{TxnContext: tctx})
}
for _, startTs := range oracleDelta.Aborts {
if posting.Txns().Get(startTs) == nil {
posting.Oracle().Done(startTs)
continue
}
tctx := &api.TxnContext{StartTs: startTs}
Expand Down