vitessio / vitess

Vitess is a database clustering system for horizontal scaling of MySQL.
http://vitess.io
Apache License 2.0
18.47k stars 2.09k forks source link

[Draft] VTGate: Update txn_rollback_shutdown_test.go to actually assert transaction rollback #16839

Open brendar opened 3 days ago

brendar commented 3 days ago

The original test does not actually assert that the transaction was rolled back. It was just asserting that a new transaction can't see rows written by the other open transaction, which is expected behavior at the default isolation level.

This test now fails with

Error:          Received unexpected error:
                target: ks.0.primary: vttablet: Statement aborted because lock(s) could not be acquired immediately and NOWAIT is set. (errno 3572) (sqlstate HY000) (CallerID: userData1): Sql: "select * from buffer where id = :id /* INT64 */ for update nowait", BindVars: {#maxLimit: "type:INT64 value:\"10001\""id: "type:INT64 value:\"3\""} (errno 3572) (sqlstate HY000) during query: select * from buffer where id = 3 for update nowait
Test:           TestTransactionRollBackWhenShutDown
Messages:       for query: select * from buffer where id = 3 for update nowait
vitess-bot[bot] commented 3 days ago

Review Checklist

Hello reviewers! :wave: Please follow this checklist when reviewing this Pull Request.

General

Tests

Documentation

New flags

If a workflow is added or modified:

Backward compatibility

codecov[bot] commented 3 days ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 69.49%. Comparing base (83b37b8) to head (9ef4340). Report is 4 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #16839 +/- ## ========================================== - Coverage 69.54% 69.49% -0.05% ========================================== Files 1569 1569 Lines 202555 202633 +78 ========================================== - Hits 140865 140829 -36 - Misses 61690 61804 +114 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.