Uh oh!
There was an error while loading. Please reload this page.
fix restore auto increment ID overflow - #458
Conversation
| // auto inc id overflow | ||
| autoIncID := table.Info.AutoIncID | ||
| if table.Info.AutoIncID < 0 { | ||
| autoIncID = math.MaxInt64 |
There was a problem hiding this comment.
what about bigint unsigned columns?
createtablea (id bigint unsigned primary key auto_increment);
insert into a values (12345678901234567890);There was a problem hiding this comment.
I was wondering that the allocator can work well 🤔️,it set the allocator with unsigned=false https://github.com/pingcap/br/blob/master/pkg/backup/client.go#L261
There was a problem hiding this comment.
How about add globalAutoID -= 1 after https://github.com/pingcap/br/blob/master/pkg/backup/client.go#L277?
There was a problem hiding this comment.
I'm not sure what's the purpose of subtracting 1 😅
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
overvenus
commented
Dec 1, 2020
Any update? |
da989b0 to
d3e2067Compare3pointer
commented
Mar 28, 2021
/run-integration-tests |
37ba16c to
36e8045Compare…into fix_restore_overflow
| autoIncID = uint64(table.Info.AutoIncID) | ||
| } else { | ||
| setValSQL = fmt.Sprintf(setValFormat, table.Info.Sequence.MaxValue) | ||
| autoIncID = uint64(table.Info.AutoIncID) | ||
| } |
There was a problem hiding this comment.
the two branches are the same? so this is simply
}
autoIncID=uint64(table.Info.AutoIncID)?
What problem does this PR solve?
when auto_increment id reached max.Int64, it can backs up success. but failed when restore. we should handle this situation.
What is changed and how it works?
if autoIncID overflowed. change is to max.Int64, to keep consistency with backup cluster.
Check List
Tests
Code changes
Side effects
Related changes
Release Note