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

Set the auto-compaction fields for Embedded-Etcd. #345

Merged
merged 1 commit into from
Jun 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions pkg/miscellaneous/miscellaneous.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ func StartEmbeddedEtcd(logger *logrus.Entry, ro *brtypes.RestoreOptions) (*embed
cfg.QuotaBackendBytes = ro.Config.EmbeddedEtcdQuotaBytes
cfg.MaxRequestBytes = ro.Config.MaxRequestBytes
cfg.MaxTxnOps = ro.Config.MaxTxnOps
cfg.AutoCompactionMode = ro.Config.AutoCompactionMode
cfg.AutoCompactionRetention = ro.Config.AutoCompactionRetention
cfg.Logger = "zap"
e, err := embed.StartEtcd(cfg)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/snapshot/restorer/restorer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ var _ = Describe("Running Restorer", func() {
maxTxnOps = 2 * 1024
embeddedEtcdQuotaBytes int64 = 8 * 1024 * 1024 * 1024
autoCompactionMode string = "periodic"
autoCompactionRetention string = "2m"
autoCompactionRetention string = "5m"
)

BeforeEach(func() {
Expand Down
2 changes: 2 additions & 0 deletions test/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ func StartEmbeddedEtcd(ctx context.Context, etcdDir string, logger *logrus.Entry
cfg.ACUrls = []url.URL{*acurl}
cfg.InitialCluster = cfg.InitialClusterFromName(cfg.Name)
cfg.Logger = "zap"
cfg.AutoCompactionMode = "periodic"
cfg.AutoCompactionRetention = "5m"
e, err := embed.StartEtcd(cfg)
if err != nil {
return nil, err
Expand Down