Skip to content

Conversation

huachaohuang
Copy link
Contributor

When the index is 0, the first operator may has started by not finished,
so we need to add a flag to check whether the balancer has started.

Closes #343.

When the index is 0, the first operator may has started by not finished,
so we need to add a flag to check whether the balancer has started.
@@ -121,6 +122,11 @@ func (bo *balanceOperator) Do(ctx *opContext, region *regionInfo) (bool, *pdpb.R
return true, nil, nil
}

if !bo.Started {
bo.Started = true
bo.Start = time.Now()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we use Start only, if Start > 0, we can think the operator is started. And we will set Start to 0 after we finish the operator.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, and we don't need Finished too, I will remove it.

@siddontang
Copy link
Contributor

LGTM

1 similar comment
@qiuyesuifeng
Copy link
Contributor

LGTM

@siddontang
Copy link
Contributor

CI failed @huachaohuang

@huachaohuang huachaohuang merged commit 69a7b34 into master Nov 7, 2016
@huachaohuang huachaohuang deleted the huachaohuang/check-started-operator branch November 7, 2016 03:54
rleungx pushed a commit to rleungx/pd that referenced this pull request Aug 6, 2025
Signed-off-by: lhy1024 <admin@liudos.us>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants