Skip to content

Instantly share code, notes, and snippets.

@alexott
Created May 18, 2020 09:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexott/2d5bf95a791450d5dc3e5f5ee11fc94c to your computer and use it in GitHub Desktop.
Save alexott/2d5bf95a791450d5dc3e5f5ee11fc94c to your computer and use it in GitHub Desktop.
Execution of Cassandra's logged batch
@startuml
hide footbox
participant "Client" as client
database "Coordinator DSE node" as cnode
database "Batchlog DSE nodes" as bnode
database "DSE Nodes" as onode
alt successful case
client -> cnode: send batch request
activate cnode
cnode -> bnode: 2 copies of batchlog\n(could be less in some edge cases)
bnode --> cnode: confirmed
alt successful batch execution
loop number of statements (done async)
cnode -> onode: execute statements
onode --> cnode: result
end
cnode -> bnode: remove batchlog
cnode --> client: confirm execution
deactivate cnode
else batch execution failed
cnode --> client: batch write timeout
loop until applied
activate bnode
bnode --> bnode: detects that batch still exist
loop number of statements (done async)
bnode -> onode: execute statements
onode --> bnode: result
end
bnode -> bnode: remove batchlog from other nodes
deactivate bnode
end
end
else batchlog write problem
cnode --> client: batchlog write timeout
client -> cnode: retry request
note right of cnode: retry request on other coordinator
end
@enduml
@alexott
Copy link
Author

alexott commented May 18, 2020

batches

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment