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

add etcd compact #18

Merged
merged 3 commits into from
May 6, 2022
Merged

add etcd compact #18

merged 3 commits into from
May 6, 2022

Conversation

lukepark327
Copy link

  • Change etcdPut spec: now return revision info
  • Process etcdCompact after etcdPut (at every rev%100==0)
  • Keep last 100 revs
  • Currently etcdCompactFrequency is 100 as default
  • Run as goroutine

log.Error("Metadium - failed to log the latest block",
"height", height, "hash", hash, "took", time.Since(tstart))
} else {
log.Info("Metadium - logged the latest block",
"height", height, "hash", hash, "took", time.Since(tstart))

if (rev%etcdCompactFrequency == 0) && (rev > 100) {
Copy link

Choose a reason for hiding this comment

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

Shouldn't "100" be replaced by etcdCompactFrequency? I.e.

if rev%etcdCompactFreqency == 0 && rev > etcdCompactFreqency {

Copy link
Author

@lukepark327 lukepark327 May 6, 2022

Choose a reason for hiding this comment

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

Thanks! I added distinct var, named etcdCompactWindow, for more generalization and flexibility.
etcdCompactWindow is set to 100 as default.

78e7ad9

Copy link
Author

Choose a reason for hiding this comment

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

And, I updated codes to apply concept of compact window. Please check the following commits: 73062f1

* apply concept of compact window
* update check logic
Copy link

@sadoci sadoci left a comment

Choose a reason for hiding this comment

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

LGTM

@MetadiumRelease MetadiumRelease merged commit 2069123 into METADIUM:metadium May 6, 2022
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