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

Size as reported by BACKUP statement is wrong #29005

Closed
dveeden opened this issue Oct 21, 2021 · 4 comments
Closed

Size as reported by BACKUP statement is wrong #29005

dveeden opened this issue Oct 21, 2021 · 4 comments
Labels
component/br This issue is related to BR of TiDB. severity/moderate type/bug The issue is confirmed as a bug.

Comments

@dveeden
Copy link
Contributor

dveeden commented Oct 21, 2021

Bug Report

1. Minimal reproduce step (Required)

USE test;
create table t(id int primary key);
insert into t value(1);
BACKUP DATABASE test TO '/tmp/test_bck1';

2. What did you expect to see? (Required)

A backup with Size>0.

3. What did you see instead (Required)

 MySQL  127.0.0.1:4000 ssl  test  SQL > BACKUP DATABASE test TO '/tmp/test_bck1';
+----------------+------+--------------------+---------------------+---------------------+
| Destination    | Size | BackupTS           | Queue Time          | Execution Time      |
+----------------+------+--------------------+---------------------+---------------------+
| /tmp/test_bck1 |    0 | 428551715438198786 | 2021-10-21 07:44:17 | 2021-10-21 07:44:17 |
+----------------+------+--------------------+---------------------+---------------------+
1 row in set (0.0249 sec)
 MySQL  127.0.0.1:4000 ssl  test  SQL > SELECT DATA_LENGTH+INDEX_LENGTH FROM information_schema.tables WHERE table_schema='test';
+--------------------------+
| DATA_LENGTH+INDEX_LENGTH |
+--------------------------+
|                     8707 |
+--------------------------+
1 row in set (0.0039 sec)
 MySQL  127.0.0.1:4000 ssl  test  SQL > \! du -sh /tmp/test_bck1
16K	/tmp/test_bck1
 MySQL  127.0.0.1:4000 ssl  test  SQL > \! ls -lh /tmp/test_bck1
total 16K
-rw-rw-r--. 1 dvaneeden dvaneeden 5.0K Oct 21 07:44 1_2_26_748765eba3cf49effbf31ce0d4d6b8c7a69fbc3ccc87853d158e4de5b8d1c4b3_1634795057078_write.sst
-rw-r--r--. 1 dvaneeden dvaneeden   78 Oct 21 07:44 backup.lock
-rw-r--r--. 1 dvaneeden dvaneeden 2.6K Oct 21 07:44 backupmeta

4. What is your TiDB version? (Required)

*************************** 1. row ***************************
tidb_version(): Release Version: v5.2.1
Edition: Community
Git Commit Hash: cd8fb24c5f7ebd9d479ed228bb41848bd5e97445
Git Branch: heads/refs/tags/v5.2.1
UTC Build Time: 2021-09-08 02:32:56
GoVersion: go1.16.4
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
1 row in set (0.0006 sec)
@dveeden dveeden added the type/bug The issue is confirmed as a bug. label Oct 21, 2021
@dveeden
Copy link
Contributor Author

dveeden commented Oct 21, 2021

/component br

@ti-chi-bot ti-chi-bot added the component/br This issue is related to BR of TiDB. label Oct 21, 2021
@3pointer
Copy link
Contributor

3pointer commented Oct 28, 2021

I believe #27508 fix it.
Thanks for report. I'm going to close this issue.

@github-actions
Copy link

Please check whether the issue should be labeled with 'affects-x.y' or 'fixes-x.y.z', and then remove 'needs-more-info' label.

@dveeden
Copy link
Contributor Author

dveeden commented Oct 28, 2021

This indeed looks fixed. However the size seems to be wrong. Looks like the size of the backupmeta isn't included in the total. However with any real backup a difference of 2.1K is negligible.

 MySQL  127.0.0.1:4000 ssl  test  SQL > USE test;
Default schema set to `test`.
Fetching table and column names from `test` for auto-completion... Press ^C to stop.
 MySQL  127.0.0.1:4000 ssl  test  SQL > create table t(id int primary key);
Query OK, 0 rows affected (0.1531 sec)
 MySQL  127.0.0.1:4000 ssl  test  SQL > insert into t value(1);
Query OK, 1 row affected (0.0108 sec)
 MySQL  127.0.0.1:4000 ssl  test  SQL > BACKUP DATABASE test TO '/tmp/test_bck1';
+----------------+------+--------------------+---------------------+---------------------+
| Destination    | Size | BackupTS           | Queue Time          | Execution Time      |
+----------------+------+--------------------+---------------------+---------------------+
| /tmp/test_bck1 | 1423 | 428711730816483330 | 2021-10-28 09:17:47 | 2021-10-28 09:17:47 |
+----------------+------+--------------------+---------------------+---------------------+
1 row in set (0.0355 sec)
 MySQL  127.0.0.1:4000 ssl  test  SQL > \! du -sh /tmp/test_bck1
12K	/tmp/test_bck1
 MySQL  127.0.0.1:4000 ssl  test  SQL > \! ls -lh /tmp/test_bck1
total 12K
-rw-rw-r--. 1 dvaneeden dvaneeden 1.4K Oct 28 09:17 1_2_28_2550d727ffe3e408af41f541b134d5e064440c25988bbecfb665933d1195a45d_1635405467328_write.sst
-rw-r--r--. 1 dvaneeden dvaneeden   78 Oct 28 09:17 backup.lock
-rw-r--r--. 1 dvaneeden dvaneeden 2.1K Oct 28 09:17 backupmeta
 MySQL  127.0.0.1:4000 ssl  test  SQL > SELECT tidb_version()\G
*************************** 1. row ***************************
tidb_version(): Release Version: v5.3.0-alpha-1229-g9a780a213
Edition: Community
Git Commit Hash: 9a780a21380cde952115e3f8e9a6b0d2fc4ba5b9
Git Branch: master
UTC Build Time: 2021-10-27 11:32:52
GoVersion: go1.16.4
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
1 row in set (0.0011 sec)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/br This issue is related to BR of TiDB. severity/moderate type/bug The issue is confirmed as a bug.
Projects
None yet
Development

No branches or pull requests

4 participants