Skip to content
Snippets Groups Projects

cleanup a bunch of stuff related to compare and swap requests

Merged Georgy Moshkin requested to merge gmoshkin/compare-and-swap-code-cleanup into master
All threads resolved!

Summary

  • fix: used to sometimes report incorrect raft term immediately after restarting

  • fix: use picodata's system connection pool for CAS requests

  • fix: unify which term is used for cas predicates

CAS predicates should always contain the current raft term, because this is what's explicitly checked in proc_cas.

Note that this will sometimes result in a EntryTermMismatch error because the latest applied entry may have a different term in case the election has started but not finished yet.

We could add this check to all the client cas precondition checks, but it's not a big deal, because we handle the situation correctly anyways.

  • refactor: move wait_index into compare_and_swap

  • refactor: compare_and_swap now accepts a deadline instead of a timeout

  • refactor: massage compare_and_swap a bit

  • fix: unify all places where we call compare_and_swap and wait for the result

  • fix: check if DdlPrepare was rolled back before waiting for DdlCommit

Rolled back as in raft log roll back, which can happen when a leader changes to one who doesn't have the entry we persisted. Not to be confused with DdlAbort.

  • fix: cas requests are always reconstructed before retrying

  • fix: TermMismatch was always retriable, when did it stop?

  • doc: add comments to retriable error codes explaing why they are retriable


  • Cherry-pick to: none
  • Docs follow-up: not necessary

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Yaroslav Dynnikov added 1 deleted label

    added 1 deleted label

  • Georgy Moshkin added 17 commits

    added 17 commits

    • ed95d2d9...2e89c858 - 4 commits from branch master
    • 2e89c858...3638d336 - 3 earlier commits
    • 9a3ddb19 - fix: check if DdlPrepare was rolled back before waiting for DdlCommit
    • 185341d0 - fix: unify all places where we call compare_and_swap and wait for the result
    • 904a10fe - refactor: massage compare_and_swap a bit
    • 2a45387d - refactor: compare_and_swap now accepts a deadline instead of a timeout
    • 15327a9f - refactor: move wait_index into compare_and_swap
    • 575a9f29 - fix: unify which term is used for cas predicates
    • bb855e66 - fix: use picodata's system connection pool for CAS requests
    • 5e1d1efa - fix: used to sometimes report incorrect raft term immediately after restarting
    • 96911a06 - refactor: move version bumping from governor Downgrade to update_instance
    • 8b418218 - refactor: make sure current state is always set from target state

    Compare with previous version

  • Georgy Moshkin resolved all threads

    resolved all threads

  • Georgy Moshkin enabled an automatic merge when the pipeline for 8b418218 succeeds

    enabled an automatic merge when the pipeline for 8b418218 succeeds

  • Yaroslav Dynnikov approved this merge request

    approved this merge request

  • changed milestone to %24.5 - Lowercase

  • Please register or sign in to reply
    Loading