Commit c88a0c5 1 parent 4128691 commit c88a0c5 Copy full SHA for c88a0c5
File tree 2 files changed +5
-0
lines changed
2 files changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -220,6 +220,9 @@ const (
220
220
TiDBBackoffLockFast = "tidb_backoff_lock_fast"
221
221
222
222
// tidb_back_off_weight is used to control the max back off time in TiDB.
223
+ // The default maximum back off time is a small value.
224
+ // BackOffWeight could multiply it to let the user adjust the maximum time for retrying.
225
+ // Only positive integers can be accepted, which means that the maximum back off time can only grow.
223
226
TiDBBackOffWeight = "tidb_back_off_weight"
224
227
225
228
// tidb_ddl_reorg_worker_cnt defines the count of ddl reorg workers.
Original file line number Diff line number Diff line change @@ -241,6 +241,8 @@ func (b *Backoffer) WithVars(vars *kv.Variables) *Backoffer {
241
241
if vars != nil {
242
242
b .vars = vars
243
243
}
244
+ // maxSleep is the max sleep time in millisecond.
245
+ // When it is multiplied by BackOffWeight, it should not be greater than MaxInt32.
244
246
if math .MaxInt32 / b .vars .BackOffWeight >= b .maxSleep {
245
247
b .maxSleep *= b .vars .BackOffWeight
246
248
}
You can’t perform that action at this time.
0 commit comments