Skip to content

[improve][txn] Handle changeToReadyState failure correctly in TC client#19308

Merged
BewareMyPower merged 2 commits intoapache:masterfrom
BewareMyPower:bewaremypower/txn-state-change-failure
Jan 27, 2023
Merged

[improve][txn] Handle changeToReadyState failure correctly in TC client#19308
BewareMyPower merged 2 commits intoapache:masterfrom
BewareMyPower:bewaremypower/txn-state-change-failure

Conversation

@BewareMyPower
Copy link
Copy Markdown
Contributor

Motivation

If changeToReadyState returns false when receiving the CommandTcClientConnectResponse, the connection will be closed but the TransactionMetaStoreHandler will still be registered.

Modifications

Add a registerToConnection method to handle the case when changeToReadyState returns false. In this case, we should fail fast, so complete the connectFuture exceptionally and does not register the TransactionMetaStoreHandler to ClientCnx.

Documentation

  • doc
  • doc-required
  • doc-not-needed
  • doc-complete

Matching PR in forked repository

PR in forked repository: BewareMyPower#18

### Motivation

If `changeToReadyState` returns false when receiving the
`CommandTcClientConnectResponse`, the connection will be closed but the
`TransactionMetaStoreHandler` will still be registered.

### Modifications

Add a `registerToConnection` method to handle the case when
`changeToReadyState` returns false. In this case, we should fail fast,
so complete the `connectFuture` exceptionally and does not register the
`TransactionMetaStoreHandler` to `ClientCnx`.
Copy link
Copy Markdown
Contributor

@nicoloboschi nicoloboschi left a comment

Choose a reason for hiding this comment

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

good catch!

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Jan 25, 2023

Codecov Report

❌ Patch coverage is 92.30769% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 62.73%. Comparing base (457a0d5) to head (9bed061).
⚠️ Report is 2955 commits behind head on master.

Files with missing lines Patch % Lines
...ulsar/client/impl/TransactionMetaStoreHandler.java 92.30% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #19308      +/-   ##
============================================
- Coverage     63.54%   62.73%   -0.81%     
- Complexity     3615    25557   +21942     
============================================
  Files          1895     1818      -77     
  Lines        137475   133078    -4397     
  Branches      15091    14635     -456     
============================================
- Hits          87355    83490    -3865     
+ Misses        42240    41857     -383     
+ Partials       7880     7731     -149     
Flag Coverage Δ
inttests 24.89% <46.15%> (+0.71%) ⬆️
systests 25.69% <0.00%> (-0.17%) ⬇️
unittests 59.95% <92.30%> (-1.63%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...ulsar/client/impl/TransactionMetaStoreHandler.java 52.00% <92.30%> (+1.76%) ⬆️

... and 347 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@BewareMyPower BewareMyPower merged commit 644be5f into apache:master Jan 27, 2023
@BewareMyPower BewareMyPower deleted the bewaremypower/txn-state-change-failure branch January 28, 2023 09:59
liangyepianzhou pushed a commit that referenced this pull request Feb 9, 2023
nicoloboschi pushed a commit to datastax/pulsar that referenced this pull request Feb 28, 2023
…nt (apache#19308)

(cherry picked from commit 644be5f)
(cherry picked from commit ddb94aa)
coderzc pushed a commit that referenced this pull request Mar 1, 2023
@coderzc coderzc added the cherry-picked/branch-2.9 Archived: 2.9 is end of life label Mar 1, 2023
Annavar-satish pushed a commit to pandio-com/pulsar that referenced this pull request Mar 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants