-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
fix: Anti-Entropy loops endlessly with empty shard #21275
Conversation
The anti-entropy service will loop trying to copy an empty shard to a data node missing that shard. This fix is one of two changes that correctly create an empty shard on a new node. This fix will set the LastModified date of an empty shard directory to the modificaiton time of that directory, instead of to the Unix epoch. Fixes: #21273
} | ||
if isEmpty { | ||
if fi, err := os.Stat(f.dir); err == nil { | ||
f.lastModified = fi.ModTime().UTC() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it need to account for tombstones? I'm not sure. TSMReader appears to: https://github.com/influxdata/influxdb/blob/master-1.x/tsdb/engine/tsm1/reader.go#L527
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it does account for tombstones. In the loop here, res.r.LastModfied()
checks the tombstones, so the directory modification time is only used if the readerC
channel is completely empty.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
The anti-entropy service will loop trying to copy an empty shard to a data node missing that shard. This fix is one of two changes that correctly create an empty shard on a new node. This fix will set the LastModified date of an empty shard directory to the modification time of that directory, instead of to the Unix epoch. Fixes: #21273 (cherry picked from commit 7f300dc)
The anti-entropy service will loop trying to copy an empty shard to a data node missing that shard. This fix is one of two changes that correctly create an empty shard on a new node. This fix will set the LastModified date of an empty shard directory to the modification time of that directory, instead of to the Unix epoch. Fixes: #21273 (cherry picked from commit 7f300dc)
The anti-entropy service will loop trying to copy an empty shard to a data node missing that shard. This fix is one of two changes that correctly create an empty shard on a new node. This fix will set the LastModified date of an empty shard directory to the modification time of that directory, instead of to the Unix epoch. Fixes: #21273 (cherry picked from commit 7f300dc)
The anti-entropy service will loop trying to copy an empty shard to a
data node missing that shard. This fix is one of two changes that
correctly create an empty shard on a new node.
Fixes: #21273
This fix will set the LastModified date of an empty shard directory to the
modification time of that directory, instead of to the Unix epoch.