Skip to content

Commit

Permalink
update limit to 10 gib and refine log
Browse files Browse the repository at this point in the history
  • Loading branch information
july2993 committed Jun 26, 2019
1 parent 8d52bbf commit ac51fc0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions cmd/pump/pump.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions pump/storage/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -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))
Expand Down
3 changes: 2 additions & 1 deletion pump/storage/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"sync/atomic"

"github.com/dustin/go-humanize"
"github.com/pingcap/errors"
)

var tsKeyPrefix = []byte("ts:")
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit ac51fc0

Please sign in to comment.