New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

store/tikv: fix gc worker. #4561

Merged
merged 4 commits into from Sep 19, 2017

Conversation

Projects
None yet
5 participants
@disksing
Member

disksing commented Sep 19, 2017

Revert the gcIsRunning part of #4453 .

The problem is the flag may be set at L181, while the gc is not actually running (may return at L187 or L193).

func (w *GCWorker) leaderTick(ctx goctx.Context) error {
if !atomic.CompareAndSwapInt32(&w.gcIsRunning, 0, 1) {
return nil
}
ok, safePoint, err := w.prepare()
if err != nil || !ok {
return errors.Trace(err)
}
// When the worker is just started, or an old GC job has just finished,
// wait a while before starting a new job.
if time.Since(w.lastFinish) < gcWaitTime {
return nil
}
log.Infof("[gc worker] %s starts GC job, safePoint: %v", w.uuid, safePoint)
go w.runGCJob(ctx, safePoint)
return nil
}

@disksing disksing requested review from coocood, atmzhou and hicqu Sep 19, 2017

@hicqu

This comment has been minimized.

Show comment
Hide comment
@hicqu

hicqu Sep 19, 2017

Contributor

LGTM.

Contributor

hicqu commented Sep 19, 2017

LGTM.

@shenli

This comment has been minimized.

Show comment
Hide comment
@shenli

shenli Sep 19, 2017

Member

LGTM

Member

shenli commented Sep 19, 2017

LGTM

@shenli

This comment has been minimized.

Show comment
Hide comment
@shenli

shenli Sep 19, 2017

Member

/run-all-tests

Member

shenli commented Sep 19, 2017

/run-all-tests

@shenli

shenli approved these changes Sep 19, 2017

@atmzhou

This comment has been minimized.

Show comment
Hide comment
@atmzhou

atmzhou Sep 19, 2017

Contributor

LGTM

Contributor

atmzhou commented Sep 19, 2017

LGTM

@coocood coocood merged commit a949c42 into master Sep 19, 2017

3 of 4 checks passed

continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
ci/circleci Your tests passed on CircleCI!
Details
jenkins-ci-tidb/build Jenkins job succeeded.
Details
license/cla Contributor License Agreement is signed.
Details

@coocood coocood deleted the disksing/gc branch Sep 19, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment