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

dumpling: compress supports snappy/zstd #38910

Merged
merged 28 commits into from Nov 14, 2022

Conversation

lyzx2001
Copy link
Contributor

@lyzx2001 lyzx2001 commented Nov 4, 2022

What problem does this PR solve?

Issue Number: ref #38514

Problem Summary:

What is changed and how it works?

  • Dumpling compress supports snappy/zstd

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

None

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Nov 4, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • lance6716
  • lichunzhu

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added release-note-none size/M Denotes a PR that changes 30-99 lines, ignoring generated files. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Nov 4, 2022
@ti-chi-bot ti-chi-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 4, 2022
@lichunzhu
Copy link
Contributor

Is this PR ready for review now?

@lyzx2001
Copy link
Contributor Author

lyzx2001 commented Nov 7, 2022

Is this PR ready for review now?

there are still 2 tests failing and I am trying to fix them

@lyzx2001
Copy link
Contributor Author

lyzx2001 commented Nov 9, 2022

/cc @lichunzhu @lance6716

Copy link
Contributor

@lichunzhu lichunzhu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rest LGTM

@@ -593,6 +593,10 @@ func ParseCompressType(compressType string) (storage.CompressType, error) {
return storage.NoCompression, nil
case "gzip", "gz":
return storage.Gzip, nil
case "snappy":
return storage.Snappy, nil
case "zst":
Copy link
Contributor

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

Suggested change
case "zst":
case "zstd":

or maybe

Suggested change
case "zst":
case "zstd","zst":

Comment on lines 105 to 139
# 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"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we merge these three parts in a for loop?

@lyzx2001
Copy link
Contributor Author

/run-all-tests

Copy link
Contributor

@lichunzhu lichunzhu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job! LGTM

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Nov 10, 2022
@lichunzhu lichunzhu added the component/dumpling This is related to Dumpling of TiDB. label Nov 10, 2022
@lance6716
Copy link
Contributor

/merge

@ti-chi-bot
Copy link
Member

@lance6716: /merge in this pull request requires 2 approval(s).

In response to this:

/merge

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository.

@lance6716
Copy link
Contributor

will review later

Copy link
Contributor

@lance6716 lance6716 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rest lgtm

@@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
go get github.com/ma6174/snappy

only need go install?

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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 get github.com/ma6174/snappy?


case $compressType in
"gzip")
gzip "${HOST_DIR}/compress/s3-schema-create.sql.gz" -d
Copy link
Contributor

@lance6716 lance6716 Nov 11, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems we can assign gzip, snappy, zst to $binary, and also assign $suffix, then use

    ${binary} "${HOST_DIR}/compress/s3-schema-create.sql.${suffix}" -d
    diff "${HOST_DIR}/local/s3-schema-create.sql" "${HOST_DIR}/compress/s3-schema-create.sql"

    ${binary} "${HOST_DIR}/compress/s3.t-schema.sql.${suffix}" -d
    diff "${HOST_DIR}/local/s3.t-schema.sql" "${HOST_DIR}/compress/s3.t-schema.sql"

    ${binary} "${HOST_DIR}/compress/s3.t.000000000.sql.${suffix}" -d
    diff "${HOST_DIR}/local/s3.t.000000000.sql" "${HOST_DIR}/compress/s3.t.000000000.sql"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

modified

@ti-chi-bot ti-chi-bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Nov 11, 2022
@lyzx2001
Copy link
Contributor Author

/run-all-tests

3 similar comments
@lyzx2001
Copy link
Contributor Author

/run-all-tests

@lyzx2001
Copy link
Contributor Author

/run-all-tests

@lyzx2001
Copy link
Contributor Author

/run-all-tests

@lichunzhu
Copy link
Contributor

/merge

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: 5ba6b50

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Nov 14, 2022
@ti-chi-bot ti-chi-bot merged commit 78d1905 into pingcap:master Nov 14, 2022
@sre-bot
Copy link
Contributor

sre-bot commented Nov 14, 2022

TiDB MergeCI notify

🔴 Bad News! New failing [3] after this pr merged.
These new failed integration tests seem to be caused by the current PR, please try to fix these new failed integration tests, thanks!

CI Name Result Duration Compare with Parent commit
idc-jenkins-ci-tidb/integration-ddl-test 🟥 failed 1, success 5, total 6 43 min New failing
idc-jenkins-ci/integration-cdc-test 🟥 failed 1, success 38, total 39 22 min New failing
idc-jenkins-ci-tidb/integration-common-test 🟥 failed 1, success 16, total 17 10 min New failing
idc-jenkins-ci-tidb/mybatis-test 🔴 failed 1, success 0, total 1 11 min Existing failure
idc-jenkins-ci-tidb/common-test 🟢 all 11 tests passed 8 min 51 sec Existing passed
idc-jenkins-ci-tidb/tics-test 🟢 all 1 tests passed 6 min 45 sec Existing passed
idc-jenkins-ci-tidb/sqllogic-test-2 🟢 all 28 tests passed 4 min 30 sec Existing passed
idc-jenkins-ci-tidb/sqllogic-test-1 🟢 all 26 tests passed 4 min 22 sec Existing passed
idc-jenkins-ci-tidb/integration-compatibility-test 🟢 all 1 tests passed 2 min 40 sec Existing passed
idc-jenkins-ci-tidb/plugin-test 🟢 build success, plugin test success 4min Existing passed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/dumpling This is related to Dumpling of TiDB. release-note-none size/M Denotes a PR that changes 30-99 lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants