Skip to content

Implement isEnsembleAdheringToPlacementPolicy in RegionAwareEnsemblePlacementPolicy - #4930

Open
hangc0276 wants to merge 1 commit into
apache:masterfrom
hangc0276:fix-region-aware-placement-adherence
Open

hangc0276 wants to merge 1 commit into
apache:masterfrom
hangc0276:fix-region-aware-placement-adherence

Conversation

@hangc0276

Copy link
Copy Markdown
Contributor

RegionAwareEnsemblePlacementPolicy did not override isEnsembleAdheringToPlacementPolicy, so it always reported MEETS_STRICT and the Auditor's placement policy check never detected (or repaired) ledgers violating the policy.

Classify each write quorum as:

  • FAIL: no known bookie, default-rack bookie when enforceMinNumRacksPerWriteQuorum is set, durability violated (only when reppRegionsToWrite is configured), or bookies sharing a region fail that region's rack-aware check (non-writable bookies are ignored).
  • MEETS_SOFT: bookies share a region but pass the per-region check.
  • MEETS_STRICT: every bookie of every quorum is in a different region.

The check takes the read lock, never populates the address2Region cache and returns FAIL on unexpected exceptions so the Auditor always makes progress. Also return the computed adherence from newEnsemble in the single-region case.

Based on #4133 by druidliu.

Descriptions of the changes in this PR:

Fix #xyz

Main Issue: #xyz

BP: #xyz

Motivation

(Explain: why you're making that change, what is the problem you're trying to solve)

Changes

(Describe: what changes you have made)


In order to uphold a high standard for quality for code contributions, Apache BookKeeper runs various precommit
checks for pull requests. A pull request can only be merged when it passes precommit checks.


Be sure to do all the following to help us incorporate your contribution
quickly and easily:

If this PR is a BookKeeper Proposal (BP):

  • Make sure the PR title is formatted like:
    <BP-#>: Description of bookkeeper proposal
    e.g. BP-1: 64 bits ledger is support
  • Attach the master issue link in the description of this PR.
  • Attach the google doc link if the BP is written in Google Doc.

Otherwise:

  • Make sure the PR title is formatted like:
    <Issue #>: Description of pull request
    e.g. Issue 123: Description ...
  • Make sure tests pass via mvn clean apache-rat:check install spotbugs:check.
  • Replace <Issue #> in the title with the actual Issue number.

…lacementPolicy

RegionAwareEnsemblePlacementPolicy did not override
isEnsembleAdheringToPlacementPolicy, so it always reported MEETS_STRICT and
the Auditor's placement policy check never detected (or repaired) ledgers
violating the policy.

Classify each write quorum as:
- FAIL: no known bookie, default-rack bookie when
  enforceMinNumRacksPerWriteQuorum is set, durability violated (only when
  reppRegionsToWrite is configured), or bookies sharing a region fail that
  region's rack-aware check (non-writable bookies are ignored).
- MEETS_SOFT: bookies share a region but pass the per-region check.
- MEETS_STRICT: every bookie of every quorum is in a different region.

The check takes the read lock, never populates the address2Region cache and
returns FAIL on unexpected exceptions so the Auditor always makes progress.
Also return the computed adherence from newEnsemble in the single-region case.

Based on apache#4133 by druidliu.

Co-authored-by: druidliu <druidliu@tencent.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant