From ac51fc0d36c528f1b232887bd9f04700792ee0b2 Mon Sep 17 00:00:00 2001 From: Jiahao Huang Date: Wed, 26 Jun 2019 17:02:53 +0800 Subject: [PATCH] update limit to 10 gib and refine log --- cmd/pump/pump.toml | 4 ++-- pump/storage/storage.go | 4 ++-- pump/storage/util.go | 3 ++- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/cmd/pump/pump.toml b/cmd/pump/pump.toml index a0af5727f..28ffa75ea 100644 --- a/cmd/pump/pump.toml +++ b/cmd/pump/pump.toml @@ -33,8 +33,8 @@ pd-urls = "http://127.0.0.1:2379" # stop write when disk available space less then the configured size # 42 MB -> 42000000, 42 mib -> 44040192 -# default: 1 gib -# stop-write-at-available-space = "1 gib" +# default: 10 gib +# stop-write-at-available-space = "10 gib" # # we suggest using the default config of the embedded LSM DB now, do not change it useless you know what you are doing diff --git a/pump/storage/storage.go b/pump/storage/storage.go index 00797c8eb..9ba47384f 100644 --- a/pump/storage/storage.go +++ b/pump/storage/storage.go @@ -44,7 +44,7 @@ const ( chanCapacity = 1 << 20 // if pump takes a long time to write binlog, pump will display the binlog meta information (unit: Second) slowWriteThreshold = 1.0 - defaultStopWriteAtAvailableSpace = 1 << 30 + defaultStopWriteAtAvailableSpace = 10 * (1 << 30) ) var ( @@ -316,7 +316,7 @@ func (a *Append) handleSortItem(items <-chan sortItem) (quit chan struct{}) { func (a *Append) updateSize() error { size, err := getStorageSize(a.dir) if err != nil { - return errors.Annotate(err, "update storage size failed") + return errors.Annotatef(err, "update storage size failed, dir: %s", a.dir) } storageSizeGauge.WithLabelValues("capacity").Set(float64(size.capacity)) diff --git a/pump/storage/util.go b/pump/storage/util.go index fad831593..4f0d6521e 100644 --- a/pump/storage/util.go +++ b/pump/storage/util.go @@ -18,6 +18,7 @@ import ( "sync/atomic" "github.com/dustin/go-humanize" + "github.com/pingcap/errors" ) var tsKeyPrefix = []byte("ts:") @@ -59,7 +60,7 @@ func (b *HumanizeBytes) UnmarshalText(text []byte) error { n, err := humanize.ParseBytes(string(text)) if err != nil { - return err + return errors.Annotatef(err, "test: %s", string(text)) } *b = HumanizeBytes(n)