Set state flag when rebalance is interrupted#292
Conversation
|
I can see where RebalanceInterrupted flag gets set, but I don’t see where it gets cleared... I guess, the point is to mirror the respective persistent marker (fname.RebalanceMarker). need to find out how does that work with existing code: https://github.com/NVIDIA/aistore/blob/main/ais/htrun.go#L216 etc. and why that's not enough. |
|
@alex-aizman the flag gets cleared in RemoveMarker, for example here I don't have a good enough mental model of the code to know for sure why https://github.com/NVIDIA/aistore/blob/main/ais/htrun.go#L216 isn't sufficient, but my understanding is just that that's never synced to the |
No, that's not true Closing. |
|
@alex-aizman those calls don't get propagated to the |
|
You can reproduce this by running |
|
how about does it reproduce with |
|
Yeah |
|
@gaikwadabhishek take a look reopening this PR... |
gaikwadabhishek
left a comment
There was a problem hiding this comment.
Hey @eric-higgins-ai , thanks for contributing. Few edge scenarios are not handled or needs exploration. In re: prometheus, the alert already exists - AISRebalanceInterrupted @ ais-k8s/monitoring/kube-prom/alert-rules/templates/native-rules.yaml.
I think if you have time this change can also be applied to resilver interrupted scenario.
| if !ok { | ||
| nlog.Warningln(rargs.logHdr, "ended streams when curr. stage:", stages[curStage]) | ||
| } else { | ||
| tstats.SetFlag(cos.NodeAlerts, cos.RebalanceInterrupted) |
There was a problem hiding this comment.
This does not cover cleanup-mode (--cleanup in ais start rebalance) rebalances. RunCleanup creates the same RebalanceMarker, but finiCleanup retains it on abort without setting RebalanceInterrupted. I reproduced this by aborting cleanup mode: the marker remained and cluster status reported interruption, while ais_target_state_flags stayed clear. Please update finiCleanup
There was a problem hiding this comment.
@eric-higgins-ai you marked this as resolved but no changes were implemented? any issue?
There was a problem hiding this comment.
ah sorry, I resolved the comments for my own bookkeeping but I haven't pushed changes yet as I'm still testing them. I can unresolve the comments
There was a problem hiding this comment.
Please handle a false return from RemoveMarker. It currently clears RebalanceInterrupted unconditionally even when marker deletion fails. I reproduced ok=false, markerExists=true, and the metric bit cleared. This leaves cluster status and Prometheus inconsistent. The bit should only be cleared after confirmed marker removal, or restored when removal fails
There was a problem hiding this comment.
the comment is for the below line
There was a problem hiding this comment.
Could a stop request arrive after Quiesce() returns but before xreb.Finish()? The marker is already removed here, but the xaction is still running, so the stop is accepted. Finish() then records it as aborted while the marker and Prometheus flag indicate success. Can we either reject late stops or update the marker after the final xaction state is known?
There was a problem hiding this comment.
this scenario is pre-existing, technically not in your scope as well. so skip this for now. but needs fixing so add a TODO atleast
Signed-off-by: eric-higgins-ai <erichiggins@applied.co>
692e142 to
98b2b3b
Compare
|
ok @gaikwadabhishek I addressed your comments. I also found a few other bugs while testing, which I also fixed:
|
I would like to use the
RebalanceInterruptedbit of theais_target_state_flagsPrometheus metric to monitor rebalance stability. However, in the current code it's never set to 1.