mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-08-30 17:13:08 +08:00
fix: splitable auto_incremental steps should be more than 1 (in case of HA setup) (#14501)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
This commit is contained in:
@@ -95,7 +95,8 @@ func (t *SSplitTableSpec) newTable(lastRecIndex int64, lastDate time.Time) (*sql
|
||||
Table: fmt.Sprintf("%s_%d", t.tableName, lastDate.Unix()),
|
||||
}
|
||||
if lastRecIndex > 0 {
|
||||
meta.Start = lastRecIndex + 1
|
||||
// auto_increment offset should consider HA setup
|
||||
meta.Start = lastRecIndex + 10000
|
||||
meta.StartDate = lastDate
|
||||
}
|
||||
err := t.metaSpec.Insert(&meta)
|
||||
|
||||
Reference in New Issue
Block a user