pilorama: disallow applying same operations (SUPPORT) #396

Merged
fyrchik merged 2 commits from fyrchik/frostfs-node:fix-tree-sync into support/v0.36 2023-05-29 10:25:27 +00:00

2 commits

Author SHA1 Message Date
785bbd5095 [#396] treesvc: properly remember last height on shutdown
All checks were successful
ci/woodpecker/pr/pre-commit Pipeline was successful
Previously `newHeight` was updated in parallel, so that applying
operation at height H did not imply successful TreeApply() for H-1.
And because we have no context in TreeUpdateLastSyncHeight(), invalid
starting height could be written if the context was canceled.

In this commit we return the new height only if all operations were
successfully applied.

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2023-05-26 17:03:37 +03:00
0ca18653b8 [#396] pilorama: Disallow applying same operations
All checks were successful
ci/woodpecker/pr/pre-commit Pipeline was successful
1. In redo() we save the old state.
2. If we do redo() for the same operation twice, the old state will be
   overritten with the new one.
3. This in turn affects undo() and subsequent isAncestor() check.

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2023-05-26 11:59:17 +03:00