From b2388dd8658bae58a5b8c533ae60aecd577eec08 Mon Sep 17 00:00:00 2001 From: Chunzhu Li Date: Mon, 11 Oct 2021 22:11:25 -0500 Subject: [PATCH] export: update error message for s3 fault and rows description (#354) --- v4/export/config.go | 3 ++- v4/export/writer_util.go | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/v4/export/config.go b/v4/export/config.go index 1e56e848..4458df27 100644 --- a/v4/export/config.go +++ b/v4/export/config.go @@ -223,7 +223,8 @@ func (conf *Config) DefineFlags(flags *pflag.FlagSet) { flags.String(flagSnapshot, "", "Snapshot position (uint64 or MySQL style string timestamp). Valid only when consistency=snapshot") flags.BoolP(flagNoViews, "W", true, "Do not dump views") flags.String(flagStatusAddr, ":8281", "dumpling API server and pprof addr") - flags.Uint64P(flagRows, "r", UnspecifiedSize, "Split table into chunks of this many rows, default unlimited") + flags.Uint64P(flagRows, "r", UnspecifiedSize, "If specified, dumpling will split table into chunks and concurrently dump them to different files to improve efficiency. For TiDB v3.0+, specify this will make dumpling split table with each file one TiDB region(no matter how many rows is).\n"+ + "If not specified, dumpling will dump table without inner-concurrency which could be relatively slow. default unlimited") flags.String(flagWhere, "", "Dump only selected records") flags.Bool(flagEscapeBackslash, true, "use backslash to escape special characters") flags.String(flagFiletype, "", "The type of export file (sql/csv)") diff --git a/v4/export/writer_util.go b/v4/export/writer_util.go index ae407f17..23d27878 100755 --- a/v4/export/writer_util.go +++ b/v4/export/writer_util.go @@ -422,6 +422,9 @@ func writeBytes(tctx *tcontext.Context, writer storage.ExternalFileWriter, p []b zap.ByteString("string", p[:outputLength]), zap.String("writer", fmt.Sprintf("%#v", writer)), zap.Error(err)) + if strings.Contains(err.Error(), "Part number must be an integer between 1 and 10000") { + err = errors.Annotate(err, "work around: dump file exceeding 50GB, please specify -F=256MB -r=200000 to avoid this problem") + } } return errors.Trace(err) }