Issue with Dumpling Unable to Export Snapshot Data

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: dumpling无法导出快照数据问题

| username: xxxxxxxx

tidb 4.0.13 version

dumpling version information

Release version:
Git commit hash: 0175843056a6068dd2f64afca6277d890934b63c
Git branch: master
Build timestamp: 2020-06-08 02:26:25Z
Go version: go version go1.13.4 linux/amd64

Test case
(1) Delete the record with id = 6737072 around 14:10
(2) Use dumpling to export the snapshot of id = 6737072 at 14:00:00
(3) Operation command
./dumpling -u root -p pass -h 127.0.0.1 -P 4001 --consistency “snapshot” --snapshot “2022-11-04 14:00:00” -T tidbtest.t -F 64m --filetype sql -r 10000 -t 2 -o out
(4) Backup result, found that the snapshot data was not backed up

(5) Query the snapshot at 14:00:00 in the database and found that it can be queried
Image

PS: If you use mydumper, it works
./mydumper -u root -p pass -h 127.0.0.1 -P 4001 -t 2 -F 32 --skip-tz-utc -o out -B tidbtest -T t -z ‘2022-11-04 14:00:00’ – This backup shows the data with id = 6737072

Above, I don’t know if it’s because I’m using the wrong command or for some other reason.

| username: weixiaobing | Original post link

You can actually check the imported file to see if there is any data. The import log might be a bit misleading.

[2022/11/04 15:48:51.850 +08:00] [INFO] [writer.go:254] [“no data written in table chunk”] [database=test] [table=t] [chunkIdx=0]

[2022/11/04 15:48:51.850 +08:00] [INFO] [collector.go:239] [“backup success summary”] [total-ranges=4] [ranges-succeed=4] [ranges-failed=0] [total-take=8.660476ms] [total-kv-size=57B] [average-speed=6.582kB/s] [total-rows=1]

[2022/11/04 15:48:51.850 +08:00] [INFO] [main.go:80] [“dump data successfully, dumpling will exit now”]

[tidb@vm172-16-201-64 tidb_script]$ cd …/backup/test/

[tidb@vm172-16-201-64 test]$ ll

total 16

-rw-rw-r-- 1 tidb tidb 147 Nov 4 15:48 metadata

-rw-rw-r-- 1 tidb tidb 95 Nov 4 15:48 test-schema-create.sql

-rw-rw-r-- 1 tidb tidb 57 Nov 4 15:48 test.t.0000000010000.sql

-rw-rw-r-- 1 tidb tidb 136 Nov 4 15:48 test.t-schema.sql

[tidb@vm172-16-201-64 test]$ more test.t.0000000010000.sql

/!40101 SET NAMES binary/;

INSERT INTO t VALUES

(1);

[tidb@vm172-16-201-64 test]$