-
Notifications
You must be signed in to change notification settings - Fork 101
BR failed to backup stats #679
Comments
The failed reason is |
This is a bug in TiDB. Still, such failure probably shouldn't abort backup/restore since stats aren't essential. also, the dump stats error should log which table is the cause. Lines 348 to 358 in 458d542
|
What is the trigger mechanism of
|
if the stats field is nil during restore, it will just be skipped. Lines 816 to 826 in 458d542
missing stats won't prevent user accessing the data, just that the queries are not optimized. ANALYZE TABLE can be performed separately. |
OK, it can be a workaround method. For a better user experience, restore needs to support |
running "analyze table" requires scanning the tables again though, which is slow (esp. when restoring from an old backup where the |
This is true, but |
As discussed with @kennytm, some consensuses are as follows
|
my preference is: 4. the option should be |
I have no problem with these preferences ⏩ For version <4.0.9, I have no special requirements. In order to restore quickly, we can allow the restore of version less than 4.0.9 not to execute |
I think we made some wrong decisions before, based on the inertia to solve the current problem. I have a new proposal. The product factors considered are as follows: I suggest not to introduce more complicated logic. Because The recommended processing logic is as follows
|
So we'll be changing how we backup stats, and also support system tables like RBAC info and global variables.
To further support logic (2), and support backward/forward compatibility,
|
I suggest we should backup the system tables, and can opt out when restoring. |
The second reason is very important and critical. As a matter of principle, we should also back up everything and restore selectively, instead of backuping selectively. |
Please answer these questions before submitting your issue. Thanks!
What did you do?
If possible, provide a recipe for reproducing the error.
Upgrade TiDB cluster from v4.0.0 to v4.0.9. then use BR v4.0.9 to backup.
What did you expect to see?
backup success.
What did you see instead?
BR v4.0.9
TiDB v4.0.9 (upgrade from v4.0.0)
The text was updated successfully, but these errors were encountered: