Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bench: Add benchmark for rollback #4459

Merged
merged 8 commits into from Jul 16, 2019

Conversation

MyonKeminta
Copy link
Contributor

Signed-off-by: MyonKeminta MyonKeminta@users.noreply.github.com

What have you changed? (mandatory)

This PR adds benchmarks for MvccTxn::rollback.

It's divided two three different cases:

  • rollback_prewrote: Prewrite happens before the rollback
  • rollback_conflict: Another transaction's Prewrite happens before the rollback
  • rollback_non_prewrote: The rollback happens before prewrite

What are the type of the changes? (mandatory)

  • Improvement (change which is an improvement to an existing feature)

How has this PR been tested? (mandatory)

By CI

Does this PR affect documentation (docs) update? (mandatory)

No

Does this PR affect tidb-ansible update? (mandatory)

No

MyonKeminta and others added 2 commits April 1, 2019 15:21
Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
@breezewish
Copy link
Member

/run-integration-tests

@overvenus overvenus added component/test-bench Component: Unit tests, Integration tests, CI, Benchmarks, etc. sig/transaction SIG: Transaction labels Apr 2, 2019
@MyonKeminta
Copy link
Contributor Author

@breeswish Do you have any idea about the failing test? Although it's not related to this PR.

@kennytm
Copy link
Contributor

kennytm commented Apr 8, 2019

The test itself was broken and has been fixed in pingcap/tidb-test#773.

/run-integration-common-test

@MyonKeminta
Copy link
Contributor Author

@breeswish PTAL, thanks!

breezewish
breezewish previously approved these changes Apr 10, 2019
Copy link
Member

@breezewish breezewish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine. How is the benchmark result?

@MyonKeminta
Copy link
Contributor Author

mvcc_rollback_prewrote/BTree_KL64_VL64                                                                                                                                                                                                       [71/1830]
                        time:   [10.225 us 10.708 us 11.218 us]
Found 12 outliers among 100 measurements (12.00%)
  3 (3.00%) high mild
  9 (9.00%) high severe
mvcc_rollback_prewrote/BTree_KL64_VL65
                        time:   [11.002 us 11.091 us 11.181 us]
Found 9 outliers among 100 measurements (9.00%)
  4 (4.00%) low mild
  4 (4.00%) high mild
  1 (1.00%) high severe

mvcc_rollback_conflict/BTree_KL64_VL64
                        time:   [13.135 us 13.226 us 13.319 us]
Found 6 outliers among 100 measurements (6.00%)
  1 (1.00%) low mild
  5 (5.00%) high mild
mvcc_rollback_conflict/BTree_KL64_VL65
                        time:   [13.257 us 13.861 us 14.551 us]
Found 17 outliers among 100 measurements (17.00%)
  3 (3.00%) low mild
  1 (1.00%) high mild
  13 (13.00%) high severe

mvcc_rollback_non_prewrote/BTree_KL64_VL64
                        time:   [11.307 us 11.798 us 12.334 us]
Found 16 outliers among 100 measurements (16.00%)
  5 (5.00%) high mild
  11 (11.00%) high severe
mvcc_rollback_non_prewrote/BTree_KL64_VL65
                        time:   [11.051 us 11.475 us 11.980 us]
Found 14 outliers among 100 measurements (14.00%)
  1 (1.00%) high mild
  13 (13.00%) high severe

mvcc_rollback_prewrote/Rocks_KL64_VL64
                        time:   [35.643 us 37.843 us 40.116 us]
mvcc_rollback_prewrote/Rocks_KL64_VL65
                        time:   [35.081 us 37.399 us 39.843 us]
Found 2 outliers among 100 measurements (2.00%)
  2 (2.00%) high mild

mvcc_rollback_conflict/Rocks_KL64_VL64
                        time:   [52.123 us 54.932 us 57.835 us]
mvcc_rollback_conflict/Rocks_KL64_VL65
                        time:   [48.584 us 50.529 us 52.538 us]
Found 1 outliers among 100 measurements (1.00%)
  1 (1.00%) high mild

mvcc_rollback_non_prewrote/Rocks_KL64_VL64
                        time:   [46.432 us 48.767 us 51.157 us]
mvcc_rollback_non_prewrote/Rocks_KL64_VL65
                        time:   [44.486 us 47.163 us 50.265 us]

txn_rollback_prewrote/BTree_KL64_VL64
                        time:   [24.663 us 25.006 us 25.323 us]
txn_rollback_prewrote/BTree_KL64_VL65
                        time:   [27.438 us 27.688 us 27.931 us]
Found 4 outliers among 100 measurements (4.00%)
  2 (2.00%) low mild
  2 (2.00%) high mild

txn_rollback_conflict/BTree_KL64_VL64
                        time:   [30.000 us 32.053 us 34.725 us]
Found 9 outliers among 100 measurements (9.00%)
  1 (1.00%) low mild
  8 (8.00%) high severe
txn_rollback_conflict/BTree_KL64_VL65
                        time:   [30.093 us 30.332 us 30.562 us]
Found 3 outliers among 100 measurements (3.00%)
  3 (3.00%) low mild

txn_rollback_non_prewrote/BTree_KL64_VL64
                        time:   [29.220 us 30.477 us 32.041 us]
Found 17 outliers among 100 measurements (17.00%)
  8 (8.00%) high mild
  9 (9.00%) high severe
txn_rollback_non_prewrote/BTree_KL64_VL65
                        time:   [27.890 us 28.497 us 29.210 us]
Found 3 outliers among 100 measurements (3.00%)
  1 (1.00%) high mild
  2 (2.00%) high severe

txn_rollback_prewrote/Rocks_KL64_VL64
                        time:   [381.48 us 394.98 us 407.82 us]
Found 3 outliers among 100 measurements (3.00%)
  2 (2.00%) high mild
  1 (1.00%) high severe
txn_rollback_prewrote/Rocks_KL64_VL65
                        time:   [374.66 us 391.05 us 408.22 us]
Found 1 outliers among 100 measurements (1.00%)
  1 (1.00%) high mild

txn_rollback_conflict/Rocks_KL64_VL64
                        time:   [382.33 us 397.98 us 414.41 us]
Found 4 outliers among 100 measurements (4.00%)
  4 (4.00%) high mild
txn_rollback_conflict/Rocks_KL64_VL65
                        time:   [371.65 us 383.53 us 395.70 us]
Found 6 outliers among 100 measurements (6.00%)
  2 (2.00%) low mild
  3 (3.00%) high mild
  1 (1.00%) high severe

txn_rollback_non_prewrote/Rocks_KL64_VL64
                        time:   [465.25 us 483.34 us 502.85 us]
Found 12 outliers among 100 measurements (12.00%)
  4 (4.00%) high mild
  8 (8.00%) high severe
txn_rollback_non_prewrote/Rocks_KL64_VL65
                        time:   [416.96 us 437.67 us 460.22 us]
Found 9 outliers among 100 measurements (9.00%)
  2 (2.00%) high mild
  7 (7.00%) high severe

AndreMouche
AndreMouche previously approved these changes Jul 11, 2019
Copy link
Member

@AndreMouche AndreMouche left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@AndreMouche
Copy link
Member

Please fix the conflicts.

@MyonKeminta MyonKeminta dismissed stale reviews from AndreMouche and breezewish via 3480361 July 15, 2019 11:33
@MyonKeminta
Copy link
Contributor Author

@AndreMouche @breeswish PTAL again thanks!
Git diff works terrible in this PR, which makes it hard to resolve conflicts... Hope this will not cause confusions to you.

Copy link
Member

@AndreMouche AndreMouche left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@MyonKeminta
Copy link
Contributor Author

/run-integration-tests

@MyonKeminta MyonKeminta added the status/LGT2 Status: PR - There are already 2 approvals label Jul 16, 2019
@MyonKeminta MyonKeminta merged commit 4998755 into tikv:master Jul 16, 2019
@MyonKeminta MyonKeminta deleted the misono/bench-rollback branch July 16, 2019 10:04
sticnarf pushed a commit to sticnarf/tikv that referenced this pull request Oct 27, 2019
Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/test-bench Component: Unit tests, Integration tests, CI, Benchmarks, etc. sig/transaction SIG: Transaction status/LGT2 Status: PR - There are already 2 approvals
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants