Skip to content

Commit

Permalink
Set the auto-compaction fields for Embedded-Etcd.
Browse files Browse the repository at this point in the history
  • Loading branch information
ishan16696 committed Jun 12, 2021
1 parent 017c6d6 commit 2b50ed5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
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

0 comments on commit 2b50ed5

Please sign in to comment.