Skip to content

Commit

Permalink
Address PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
morgo committed Sep 5, 2023
1 parent 597b03e commit b0a786c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
4 changes: 1 addition & 3 deletions pkg/checksum/checker.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ import (
"golang.org/x/sync/errgroup"
)

var binlogFlushIntervalDuringChecksum = 30 * time.Second

type Checker struct {
sync.Mutex
table *table.TableInfo
Expand Down Expand Up @@ -209,7 +207,7 @@ func (c *Checker) Run(ctx context.Context) error {
// - If they are there, they will take a huge amount of time to flush
// - The memory requirements for 1MM deltas seems reasonable, but for a multi-day
// checksum it is reasonable to assume it may exceed this.
go c.feed.StartPeriodicFlush(ctx, binlogFlushIntervalDuringChecksum)
go c.feed.StartPeriodicFlush(ctx, repl.DefaultFlushInterval)
defer c.feed.StopPeriodicFlush()

g, errGrpCtx := errgroup.WithContext(ctx)
Expand Down
6 changes: 1 addition & 5 deletions pkg/migration/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,6 @@ var (
checkpointDumpInterval = 50 * time.Second
tableStatUpdateInterval = 5 * time.Minute
statusInterval = 30 * time.Second
// binlogPerodicFlushInterval is the time that the client will flush all binlog changes to disk.
// Longer values require more memory, but permit more merging.
// I expect we will change this to 1hr-24hr in the future.
binlogPerodicFlushInterval = 30 * time.Second
)

func (s migrationState) String() string {
Expand Down Expand Up @@ -429,7 +425,7 @@ func (r *Runner) setup(ctx context.Context) error {
// Continuously update the min/max and estimated rows
// and to flush the binary log position periodically.
go r.table.AutoUpdateStatistics(ctx, tableStatUpdateInterval, r.logger)
go r.replClient.StartPeriodicFlush(ctx, binlogPerodicFlushInterval)
go r.replClient.StartPeriodicFlush(ctx, repl.DefaultFlushInterval)
return nil
}

Expand Down
4 changes: 4 additions & 0 deletions pkg/repl/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ const (
// multiple-flush-threads, which should help it group commit and still be fast.
DefaultBatchSize = 1000
flushThreads = 16
// DefaultFlushInterval is the time that the client will flush all binlog changes to disk.
// Longer values require more memory, but permit more merging.
// I expect we will change this to 1hr-24hr in the future.
DefaultFlushInterval = 30 * time.Second
)

type queuedChange struct {
Expand Down

0 comments on commit b0a786c

Please sign in to comment.