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

drainer/: Reduce memory usage (#735) #737

Merged
merged 23 commits into from
Sep 25, 2019
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
0dfc864
Change unreasonable buff size and reduce memory usage
lichunzhu Sep 2, 2019
212d716
Merge branch 'master' of https://github.com/pingcap/tidb-binlog into …
lichunzhu Sep 2, 2019
4520757
wait for 0.01s for goroutines to update status
lichunzhu Sep 2, 2019
04d71a1
Merge branch 'master' of https://github.com/pingcap/tidb-binlog into …
lichunzhu Sep 9, 2019
8a6124a
change defaultBinlogItemCount to 8; revise /tests/status/run.sh to sk…
lichunzhu Sep 9, 2019
b860497
fix check error
lichunzhu Sep 9, 2019
dafce05
Merge branch 'master' of https://github.com/pingcap/tidb-binlog into …
lichunzhu Sep 11, 2019
f9fc0e0
Merge branch 'master' of https://github.com/pingcap/tidb-binlog into …
lichunzhu Sep 11, 2019
e21f41c
Merge branch 'czli/drainer/reduceMemoryUsage' of https://github.com/l…
lichunzhu Sep 11, 2019
9bd6252
eliminate loader & syncer buffer usage
lichunzhu Sep 11, 2019
e513e0d
Merge branch 'czli/drainer/reduceMemoryUsage' of https://github.com/l…
lichunzhu Sep 12, 2019
4b74231
reduce memory usage for success channel
lichunzhu Sep 12, 2019
1e51514
add txn manager
lichunzhu Sep 16, 2019
60bd55e
remove info clear and reduce success channel buffer
lichunzhu Sep 18, 2019
be6146d
Merge branch 'master' into czli/drainer/reduceMemoryUsage
july2993 Sep 23, 2019
9b4a2e5
Add more comments and logs for txnManager. Refine txnManager's code.
lichunzhu Sep 24, 2019
e6aded0
simplify atomic operations
lichunzhu Sep 24, 2019
6ddab70
Merge branch 'master' into czli/drainer/reduceMemoryUsage
IANTHEREAL Sep 24, 2019
03427a7
add two unit tests for txnManager to test whether txnManager can quit…
lichunzhu Sep 25, 2019
21d4efc
reduce wait time
lichunzhu Sep 25, 2019
6789bdf
simplify load_test
lichunzhu Sep 25, 2019
81e586c
simplify failMsg
lichunzhu Sep 25, 2019
64aa654
Update pkg/loader/load_test.go
lichunzhu Sep 25, 2019
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: 1 addition & 1 deletion drainer/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const (

var (
maxBinlogItemCount int
defaultBinlogItemCount = 512
defaultBinlogItemCount = 0
supportedCompressors = [...]string{"gzip"}
newZKFromConnectionString = zk.NewFromConnectionString
)
Expand Down
2 changes: 1 addition & 1 deletion drainer/merge.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ func NewMerger(ts int64, strategy string, sources ...MergeSource) *Merger {
m := &Merger{
latestTS: ts,
sources: make(map[string]MergeSource),
output: make(chan MergeItem, 10),
output: make(chan MergeItem),
strategy: mergeStrategy,
}

Expand Down
2 changes: 1 addition & 1 deletion drainer/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ var (
Subsystem: "drainer",
Name: "read_binlog_size",
Help: "Bucketed histogram of size of a binlog.",
Buckets: prometheus.ExponentialBuckets(16, 2, 20),
Buckets: prometheus.ExponentialBuckets(16, 2, 25),
}, []string{"nodeID"})

queueSizeGauge = prometheus.NewGaugeVec(
Expand Down
2 changes: 1 addition & 1 deletion drainer/pump.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import (
)

const (
binlogChanSize = 10
binlogChanSize = 0
)

// Pump holds the connection to a pump node, and keeps the savepoint of binlog last read
Expand Down
2 changes: 2 additions & 0 deletions drainer/pump_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,12 @@ func (s *pumpSuite) TestPullBinlog(c *C) {

// ascending commitTs order
pullBinlogCommitTSChecker(commitTsArray, ret, binlogBytesChan, c)
time.Sleep(10 * time.Microsecond)
lichunzhu marked this conversation as resolved.
Show resolved Hide resolved
c.Assert(p.latestTS, Equals, commitTsArray[len(commitTsArray)-1])

// should omit disorder binlog item, latestTs should be 29
pullBinlogCommitTSChecker(wrongCommitTsArray, ret, binlogBytesChan, c)
time.Sleep(10 * time.Microsecond)
c.Assert(p.latestTS, Equals, wrongCommitTsArray[len(wrongCommitTsArray)-2])
}

Expand Down