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
dumpling: compress supports snappy/zstd #38910
Changes from 17 commits
88a8841
d3443f1
4fbb17c
8d15c12
cff6ee6
f5e11ac
cfa6563
5256527
628f704
fe1e21d
2626711
12c54b8
7a81d30
8c158cc
fc5281c
b067c88
48fa4db
808277c
d2b7560
a6accde
40e0584
5c7072e
f303c95
bd2de30
556bb36
bdc2814
5ba6b50
f43b8af
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -15,3 +15,11 @@ chmod a+x bin/minio | |||
|
||||
wget https://dl.minio.io/client/mc/release/linux-amd64/mc -O bin/mc | ||||
chmod a+x bin/mc | ||||
|
||||
go get github.com/ma6174/snappy | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
only need go install? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. error encountered in CI integration test https://github.com/pingcap/tidb/actions/runs/3444134903/jobs/5746413416#step:6:7138 i think maybe should add back |
||||
go install github.com/ma6174/snappy | ||||
|
||||
wget https://github.com/facebook/zstd/releases/download/v1.5.2/zstd-1.5.2.tar.gz | ||||
tar xvfz zstd-1.5.2.tar.gz | ||||
cd zstd-1.5.2 | ||||
make |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -80,6 +80,7 @@ echo "1st records count is ${cnt}" | |
# run dumpling with compress option | ||
export DUMPLING_OUTPUT_DIR=s3://mybucket/dump-compress | ||
|
||
# test gzip | ||
run_dumpling --s3.endpoint="http://$S3_ENDPOINT/" --compress "gzip" | ||
|
||
mkdir -p "${HOST_DIR}/compress" | ||
|
@@ -97,4 +98,44 @@ diff "${HOST_DIR}/local/s3.t-schema.sql" "${HOST_DIR}/compress/s3.t-schema.sql" | |
gzip "${HOST_DIR}/compress/s3.t.000000000.sql.gz" -d | ||
diff "${HOST_DIR}/local/s3.t.000000000.sql" "${HOST_DIR}/compress/s3.t.000000000.sql" | ||
|
||
rm "${HOST_DIR}/compress/s3-schema-create.sql" | ||
rm "${HOST_DIR}/compress/s3.t-schema.sql" | ||
rm "${HOST_DIR}/compress/s3.t.000000000.sql" | ||
|
||
# test snappy | ||
run_dumpling --s3.endpoint="http://$S3_ENDPOINT/" --compress "snappy" | ||
|
||
bin/mc cp minio/mybucket/dump-compress/s3-schema-create.sql.snappy "${HOST_DIR}/compress/s3-schema-create.sql.snappy" | ||
bin/mc cp minio/mybucket/dump-compress/s3.t-schema.sql.snappy "${HOST_DIR}/compress/s3.t-schema.sql.snappy" | ||
bin/mc cp minio/mybucket/dump-compress/s3.t.000000000.sql.snappy "${HOST_DIR}/compress/s3.t.000000000.sql.snappy" | ||
|
||
snappy -d "${HOST_DIR}/compress/s3-schema-create.sql.snappy" | ||
diff "${HOST_DIR}/local/s3-schema-create.sql" "${HOST_DIR}/compress/s3-schema-create.sql" | ||
|
||
snappy -d "${HOST_DIR}/compress/s3.t-schema.sql.snappy" | ||
diff "${HOST_DIR}/local/s3.t-schema.sql" "${HOST_DIR}/compress/s3.t-schema.sql" | ||
|
||
snappy -d "${HOST_DIR}/compress/s3.t.000000000.sql.snappy" | ||
diff "${HOST_DIR}/local/s3.t.000000000.sql" "${HOST_DIR}/compress/s3.t.000000000.sql" | ||
|
||
rm "${HOST_DIR}/compress/s3-schema-create.sql" | ||
rm "${HOST_DIR}/compress/s3.t-schema.sql" | ||
rm "${HOST_DIR}/compress/s3.t.000000000.sql" | ||
|
||
# test zstd | ||
run_dumpling --s3.endpoint="http://$S3_ENDPOINT/" --compress "zst" | ||
|
||
bin/mc cp minio/mybucket/dump-compress/s3-schema-create.sql.zst "${HOST_DIR}/compress/s3-schema-create.sql.zst" | ||
bin/mc cp minio/mybucket/dump-compress/s3.t-schema.sql.zst "${HOST_DIR}/compress/s3.t-schema.sql.zst" | ||
bin/mc cp minio/mybucket/dump-compress/s3.t.000000000.sql.zst "${HOST_DIR}/compress/s3.t.000000000.sql.zst" | ||
|
||
zstd "${HOST_DIR}/compress/s3-schema-create.sql.zst" -d | ||
diff "${HOST_DIR}/local/s3-schema-create.sql" "${HOST_DIR}/compress/s3-schema-create.sql" | ||
|
||
zstd "${HOST_DIR}/compress/s3.t-schema.sql.zst" -d | ||
diff "${HOST_DIR}/local/s3.t-schema.sql" "${HOST_DIR}/compress/s3.t-schema.sql" | ||
|
||
zstd "${HOST_DIR}/compress/s3.t.000000000.sql.zst" -d | ||
diff "${HOST_DIR}/local/s3.t.000000000.sql" "${HOST_DIR}/compress/s3.t.000000000.sql" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we merge these three parts in a for loop? |
||
|
||
run_sql "drop database if exists \`$DB_NAME\`;" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean this? It's different with the description in comment
or maybe