Skip to content
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

kv/gc: don't continue iterating and spamming logs when deadline exceeded #51079

Merged
merged 1 commit into from
Jul 9, 2020

Conversation

nvanbenschoten
Copy link
Member

Before this change, we'd see logs like:

W200706 11:23:10.682177 15143568003 kv/kvserver/gc/gc.go:337  [n118,gc,s118,r6153/1:/Table/57/1/"user1216{19…-44…}] failed to GC a batch of keys: result is ambiguous (context deadline exceeded)
W200706 11:23:10.685251 15143568003 kv/kvserver/gc/gc.go:337  [n118,gc,s118,r6153/1:/Table/57/1/"user1216{19…-44…}] failed to GC a batch of keys: aborted during Replica.Send: context deadline exceeded
W200706 11:23:10.688667 15143568003 kv/kvserver/gc/gc.go:337  [n118,gc,s118,r6153/1:/Table/57/1/"user1216{19…-44…}] failed to GC a batch of keys: aborted during Replica.Send: context deadline exceeded
W200706 11:23:10.691760 15143568003 kv/kvserver/gc/gc.go:337  [n118,gc,s118,r6153/1:/Table/57/1/"user1216{19…-44…}] failed to GC a batch of keys: aborted during Replica.Send: context deadline exceeded
...

if a GC attempt hit its deadline. Now, we terminate iteration early and do our best to stop running GC once the context is canceled / exceeding its deadline.

@nvanbenschoten nvanbenschoten requested a review from ajwerner July 7, 2020 19:06
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Contributor

@ajwerner ajwerner left a comment

Choose a reason for hiding this comment

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

:lgtm: the linter is complaining about code I don’t think you touched.

Reviewed 1 of 1 files at r1.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained

Before this change, we'd see logs like:
```
W200706 11:23:10.682177 15143568003 kv/kvserver/gc/gc.go:337  [n118,gc,s118,r6153/1:/Table/57/1/"user1216{19…-44…}] failed to GC a batch of keys: result is ambiguous (context deadline exceeded)
W200706 11:23:10.685251 15143568003 kv/kvserver/gc/gc.go:337  [n118,gc,s118,r6153/1:/Table/57/1/"user1216{19…-44…}] failed to GC a batch of keys: aborted during Replica.Send: context deadline exceeded
W200706 11:23:10.688667 15143568003 kv/kvserver/gc/gc.go:337  [n118,gc,s118,r6153/1:/Table/57/1/"user1216{19…-44…}] failed to GC a batch of keys: aborted during Replica.Send: context deadline exceeded
W200706 11:23:10.691760 15143568003 kv/kvserver/gc/gc.go:337  [n118,gc,s118,r6153/1:/Table/57/1/"user1216{19…-44…}] failed to GC a batch of keys: aborted during Replica.Send: context deadline exceeded
...
```

if a GC attempt hit its deadline. Now, we terminate iteration early and
do our best to stop running GC once the context is canceled / exceeding
its deadline.
@nvanbenschoten nvanbenschoten force-pushed the nvanbenschoten/gcCtxErr branch from 2136b94 to 70cce48 Compare July 9, 2020 15:00
@nvanbenschoten
Copy link
Member Author

TFTR!

the linter is complaining about code I don’t think you touched.

Done.

bors r+

@craig
Copy link
Contributor

craig bot commented Jul 9, 2020

Build failed (retrying...)

@craig
Copy link
Contributor

craig bot commented Jul 9, 2020

Build succeeded

@craig craig bot merged commit a1ee982 into cockroachdb:master Jul 9, 2020
@nvanbenschoten nvanbenschoten deleted the nvanbenschoten/gcCtxErr branch July 15, 2020 16:31
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.

3 participants