feat(raft): classify writes, reject them on follower nodes

This commit is contained in:
2026-07-30 19:07:58 +03:00
parent 8a35a838d0
commit 38c1c01841
4 changed files with 36 additions and 3 deletions
+9
View File
@@ -178,3 +178,12 @@ proc isDDL*(stmt: Node): bool =
result = true
else:
result = false
proc isWrite*(stmt: Node): bool =
## True for statements that mutate stored data. `nkCommitTxn` is included
## because COMMIT emits the transaction's buffered kvPairs.
case stmt.kind
of nkInsert, nkUpdate, nkDelete, nkMerge, nkCommitTxn:
result = true
else:
result = false