Skip to content

Commit

Permalink
Merge pull request #345 from ishan16696/working
Browse files Browse the repository at this point in the history
Set the auto-compaction fields for Embedded-Etcd.
  • Loading branch information
shreyas-s-rao authored Jun 30, 2021
2 parents 1bc7b57 + 2b50ed5 commit 43af3ca
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 43af3ca

Please sign in to comment.