Cancel tree sync on errors #1621

Merged
fyrchik merged 2 commits from fyrchik/frostfs-node:tree-sync-error into master 2025-02-03 09:37:56 +00:00
Owner
No description provided.
requested reviews from storage-core-committers, storage-core-developers 2025-01-30 07:38:43 +00:00
aarifullin reviewed 2025-01-30 09:16:59 +00:00
@ -168,0 +171,4 @@
select {
case merged <- ms[minTimeMoveIndex]:
case <-ctx.Done():
return minStreamedLastHeight
Member

If context is done, then we may get newHeight = math.MaxUint64 + 1 -> newHeight = 0 because applyOperationStream may not return an error

https://git.frostfs.info/TrueCloudLab/frostfs-node/src/branch/master/pkg/services/tree/sync.go#L315-L320

So, we should compare it with from to properly choose the height we start from when the next sync will come

If context is done, then we may get `newHeight = math.MaxUint64 + 1 -> newHeight = 0` because `applyOperationStream` may not return an error https://git.frostfs.info/TrueCloudLab/frostfs-node/src/branch/master/pkg/services/tree/sync.go#L315-L320 So, we should compare it with `from` to properly choose the height we start from when the next sync will come
Author
Owner

But I think it is the behaviour, that was here before this PR, it was still possible to exit with minStreamedLastHeight = math.MaxUint64, no?

But I think it is the behaviour, that was here before this PR, it was still possible to exit with `minStreamedLastHeight = math.MaxUint64`, no?
Member

I believe that was incorrect from the very beginning. TBH, I don't remember the task context in details. But glancing at mergeOperationStreams I conclude it has returned MaxUint64, probably, never. So, we never reached newHeight = 0

I believe that was incorrect from the very beginning. TBH, I don't remember the task context in details. But glancing at `mergeOperationStreams` I conclude it has returned `MaxUint64`, probably, _never_. So, we never reached `newHeight = 0`
aarifullin marked this conversation as resolved
fyrchik force-pushed tree-sync-error from 85d23ddf2c to 89dd9660f7 2025-01-30 12:38:10 +00:00 Compare
acid-ant approved these changes 2025-01-31 12:18:32 +00:00
elebedeva approved these changes 2025-01-31 13:07:31 +00:00
aarifullin approved these changes 2025-02-03 09:36:53 +00:00
fyrchik merged commit 6fcae9f75a into master 2025-02-03 09:37:56 +00:00
fyrchik deleted branch tree-sync-error 2025-02-03 09:38:02 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
4 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: TrueCloudLab/frostfs-node#1621
No description provided.