Skip to content

[fix][test] flaky test ManagedLedgerBkTest.asyncMarkDeleteAndClose - #18362

Merged
Technoboy- merged 1 commit into
apache:masterfrom
poorbarcode:flaky_asyncMarkDeleteAndClose_2
Nov 19, 2022
Merged

Technoboy- merged 1 commit into
apache:masterfrom
poorbarcode:flaky_asyncMarkDeleteAndClose_2

Conversation

@poorbarcode

Copy link
Copy Markdown
Contributor

Fixes #16729

Motivation

same as #18310

ManagedCursorImpl has a known problem: when the cursor.close and the cursor.switchLedger are concurrent executing, a bad version exception is thrown. see:

if (e instanceof MetaStoreException.BadVersionException) {
log.warn("[{}] Failed to update cursor metadata for {} due to version conflict {}",
ledger.name, name, e.getMessage());
// it means previous owner of the ml might have updated the version incorrectly. So, check
// the ownership and refresh the version again.
if (ledger.mlOwnershipChecker != null && ledger.mlOwnershipChecker.get()) {
ledger.getStore().asyncGetCursorInfo(ledger.getName(), name,
new MetaStoreCallback<ManagedCursorInfo>() {
@Override
public void operationComplete(ManagedCursorInfo info, Stat stat) {
updateCursorLedgerStat(info, stat);
}
@Override
public void operationFailed(MetaStoreException e) {
if (log.isDebugEnabled()) {
log.debug(
"[{}] Failed to refresh cursor metadata-version for {} due "
+ "to {}", ledger.name, name, e.getMessage());
}
}
});
}
}
callback.operationFailed(e);

Modifications

  • managedLedger.close triggers the cursor.close, so remove code cursor.close
  • if managedLedger.close fail, just retry, it will be ok

Documentation

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

Matching PR in forked repository

PR in forked repository:

@github-actions github-actions Bot added the doc-not-needed Your PR changes do not impact docs label Nov 7, 2022
@poorbarcode
poorbarcode force-pushed the flaky_asyncMarkDeleteAndClose_2 branch from 4db61d1 to 76abd0e Compare November 10, 2022 13:36
@codecov-commenter

codecov-commenter commented Nov 10, 2022 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 47.12%. Comparing base (8b404d4) to head (fd24928).
⚠️ Report is 3293 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #18362      +/-   ##
============================================
- Coverage     47.15%   47.12%   -0.03%     
+ Complexity    10432    10411      -21     
============================================
  Files           697      698       +1     
  Lines         68023    67986      -37     
  Branches       7284     7271      -13     
============================================
- Hits          32074    32041      -33     
- Misses        32367    32400      +33     
+ Partials       3582     3545      -37     
Flag Coverage Δ
unittests 47.12% <ø> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 59 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.

@poorbarcode

Copy link
Copy Markdown
Contributor Author

/pulsarbot rerun-failure-checks

@tisonkun tisonkun changed the title [fix][test]fix flaky test ManagedLedgerBkTest.asyncMarkDeleteAndClose [fix][test] flaky test ManagedLedgerBkTest.asyncMarkDeleteAndClose Nov 15, 2022

@tisonkun tisonkun left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Although I suspect we may not retry on failure, the change is OK to merge.

@Technoboy- Technoboy- closed this Nov 19, 2022
@Technoboy- Technoboy- reopened this Nov 19, 2022
@Technoboy-
Technoboy- force-pushed the flaky_asyncMarkDeleteAndClose_2 branch from 76abd0e to fd24928 Compare November 19, 2022 04:12
@Technoboy-
Technoboy- merged commit 46ffb39 into apache:master Nov 19, 2022
@poorbarcode
poorbarcode deleted the flaky_asyncMarkDeleteAndClose_2 branch November 21, 2022 05:06
lifepuzzlefun pushed a commit to lifepuzzlefun/pulsar that referenced this pull request Dec 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc-not-needed Your PR changes do not impact docs ready-to-test type/flaky-tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Flaky-test: ManagedLedgerBkTest.asyncMarkDeleteAndClose

5 participants