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

compactor: Make periodic compactor runs every hour #7875

Merged
merged 1 commit into from
May 4, 2017

Conversation

yudai
Copy link
Contributor

@yudai yudai commented May 4, 2017

Closes #7868.

Copy link
Contributor

@heyitsanthony heyitsanthony left a comment

Choose a reason for hiding this comment

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

OK in general

@@ -41,6 +42,8 @@ type RevGetter interface {
Rev() int64
}

// Periodic compacts the log by purging revisions older than
// the configured retention time. Compaction happenes every hour.
Copy link
Contributor

Choose a reason for hiding this comment

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

s/happenes every hour/happens hourly

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks! Done.

return -1
return -1, t.revs
}
if i >= len(t.revs) {
Copy link
Contributor

Choose a reason for hiding this comment

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

would/should this ever evaluate as true?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

With the current code, it's evaluated only when h is 0.
It was for just in case, so I removed it.

}

// compaction doesn't happen til 2 hours elapses
if i+1 >= retentionHours {
Copy link
Contributor

Choose a reason for hiding this comment

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

save an indent level?

if i+1 < retentionHours {
    continue
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@heyitsanthony heyitsanthony added this to the v3.3.0 milestone May 4, 2017
@@ -41,6 +42,8 @@ type RevGetter interface {
Rev() int64
}

// Periodic compacts the log by purging revisions older than
// the configured retention time. Compaction happenes hourly.
Copy link
Contributor

Choose a reason for hiding this comment

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

s/happenes/happens

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops, sorry. Fixed.

@heyitsanthony
Copy link
Contributor

/cc @xiang90

@heyitsanthony
Copy link
Contributor

lgtm, thanks!

@xiang90 may have some additional thoughts on this since he wrote the original, but this seems OK to me. Compaction is optimized some so the performance impact from the additional compacts should be negligible. The description of --auto-compaction-retention is flexible enough to change the behavior without violating any guarantees.

@xiang90
Copy link
Contributor

xiang90 commented May 4, 2017

LGTM. I am aware of this potential issue. Not sure if I should do it at that time.

@yudai Thanks for improving this.

@codecov-io
Copy link

codecov-io commented May 4, 2017

Codecov Report

❗ No coverage uploaded for pull request base (master@505bf8c). Click here to learn what that means.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #7875   +/-   ##
=========================================
  Coverage          ?   75.93%           
=========================================
  Files             ?      332           
  Lines             ?    26205           
  Branches          ?        0           
=========================================
  Hits              ?    19900           
  Misses            ?     4891           
  Partials          ?     1414
Impacted Files Coverage Δ
compactor/compactor.go 82.69% <100%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 505bf8c...60dbad5. Read the comment docs.

@xiang90 xiang90 merged commit c3b96f8 into etcd-io:master May 4, 2017
@yudai yudai mentioned this pull request Mar 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants