Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign up*: support auto_increment_increment & auto_increment_offset. #14301
+345
−73
Conversation
This comment has been minimized.
This comment has been minimized.
|
/run-unit-test |
This comment has been minimized.
This comment has been minimized.
|
/bench |
This comment has been minimized.
This comment has been minimized.
sre-bot
commented
Jan 2, 2020
Benchmark Report
@@ Benchmark Diff @@
================================================================================
--- tidb: 5d76de903a6d2c95f83da365e5d757dad9fb9e7b
+++ tidb: 6dba49685cc9595d930c78a202b90b657bcd3cc1
tikv: 267a5ebf7edb229cc53f5a8faa71975225bc6d8e
pd: ea974c9488b8d304a72916d8cc50962f5ab99c5d
================================================================================
oltp_update_index:
* QPS: 6369.24 ± 0.65% (std=29.06) delta: -0.21% (p=0.743)
* Latency p50: 20.03 ± 0.35% (std=0.07) delta: -0.10%
* Latency p99: 37.23 ± 0.90% (std=0.34) delta: -0.92%
oltp_insert:
* QPS: 4702.86 ± 0.32% (std=11.54) delta: 0.16% (p=0.395)
* Latency p50: 27.21 ± 0.33% (std=0.07) delta: -0.17%
* Latency p99: 45.42 ± 6.42% (std=1.89) delta: -3.46%
oltp_read_write:
* QPS: 15845.50 ± 0.26% (std=29.71) delta: 0.21% (p=0.875)
* Latency p50: 162.33 ± 0.84% (std=0.84) delta: 0.08%
* Latency p99: 322.04 ± 8.78% (std=16.97) delta: 1.48%
oltp_point_select:
* QPS: 43423.43 ± 0.93% (std=247.68) delta: 1.61% (p=0.012)
* Latency p50: 2.95 ± 0.23% (std=0.00) delta: -1.39%
* Latency p99: 9.60 ± 2.21% (std=0.14) delta: 0.44%
oltp_update_non_index:
* QPS: 4746.72 ± 0.23% (std=6.78) delta: 0.23% (p=0.163)
* Latency p50: 26.96 ± 0.23% (std=0.04) delta: -0.24%
* Latency p99: 40.86 ± 1.19% (std=0.34) delta: -1.09%
|
This comment has been minimized.
This comment has been minimized.
|
/build |
This comment has been minimized.
This comment has been minimized.
|
/run-unit-test |
1 similar comment
This comment has been minimized.
This comment has been minimized.
|
/run-unit-test |
| if e.handleErr(col, &autoDatum, cnt, err) != nil { | ||
| return nil, err | ||
| } | ||
| // It's compatible with mysql setting the first allocated autoID to lastInsertID. | ||
| // Cause autoID may be specified by user, judge only the first row is not suitable. | ||
| if e.lastInsertID == 0 { | ||
| e.lastInsertID = uint64(min) + 1 | ||
| e.lastInsertID = uint64(min) |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
AilinKid
Jan 7, 2020
Author
Contributor
we already derive the firstID and increment from the allocated range.
AllocBatchAutoIncrementValue now return firstID and increment.
|
LGTM |
This comment has been minimized.
This comment has been minimized.
|
LGTM |
This comment has been minimized.
This comment has been minimized.
sre-bot
commented
Jan 8, 2020
|
/run-all-tests |
This comment has been minimized.
This comment has been minimized.
sre-bot
commented
Jan 8, 2020
|
cherry pick to release-3.0 failed |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
AilinKid commentedDec 31, 2019
•
edited by bb7133
What problem does this PR solve?
Fix #14245
Support auto_increment_increment & auto_increment_offset.
What is changed and how it works?
Check List
Tests
Code changes
func CalcNeededIDs(base, n, increment, offset int64, isUnsigned bool) int64
Alloc(tableID int64, n uint64, increment, offset int64) (int64, int64, error)
Related changes
Release note
auto_increment_increment&auto_increment_offset.