GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [fix][broker] Don't swap the local metadata store's synchronizer when configurationMetadataSyncEventTopic is updated on a shared store by poorbarcode · Pull Request #22695 · apache/pulsar

Conversation

@poorbarcode

@poorbarcode poorbarcode commented May 10, 2024 •
edited by merlimat
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Originally by @poorbarcode, now narrowed to a guard.

Motivation

When configurationMetadataStoreUrl is the same as metadataStoreUrl (the default when it is unset), PulsarService uses one store instance for both. Setting configurationMetadataSyncEventTopic dynamically then runs initConfigMetadataSynchronizerIfNeeded(), which only checks instanceof MetadataStoreExtended before it calls:

MetadataStoreExtended metadataStoreExtended = (MetadataStoreExtended) configurationMetadataStore;
metadataStoreExtended.updateMetadataEventSynchronizer(newSynchronizer);

Because that instance is also the local store, every local put or delete now calls synchronizer.notify() first (AbstractMetadataStore). The call fails with producer is not started yet until the producer starts. Loading the sync topic needs managed-ledger metadata writes on that same store, so the producer never starts. After that, every local metadata write fails (ownership, topic creation, ledger rollover). deleteDynamicConfiguration can't undo the setting either, because it is a write to the same store.

Example on one broker with a shared store:

pulsar-admin brokers update-dynamic-config --config configurationMetadataSyncEventTopic \
    --value persistent://pulsar/system/__sync_config_meta
pulsar-admin namespaces create public/ns1   # fails: producer is not started yet

Modifications

  • PulsarService#isConfigurationMetadataStoreSharedWithLocal() returns whether the two stores are the same instance.
  • initConfigMetadataSynchronizerIfNeeded() logs a warning and does nothing when the stores are shared. This matches startup, which already ignores the configuration sync topic in that case.
  • BrokersBase#persistDynamicConfigurationAsync rejects configurationMetadataSyncEventTopic with 412 when the stores are shared. Delete is still allowed, so a value persisted earlier can be cleared.

Compared with the earlier version of this PR, this adds no new configuration, keeps one store instance, and leaves the existing tests unchanged.

Verifying this change

SyncConfigStoreSharedWithLocalTest starts two brokers whose configuration store URL equals the local URL. It checks that:

  • the admin update returns 412 and nothing is persisted;
  • applying the setting directly does not create a synchronizer, and namespace and topic creation still succeed afterwards.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@poorbarcode poorbarcode added type/bug The PR fixed a bug or issue reported a bug release/3.0.5 release/3.3.1 labels May 10, 2024
@poorbarcode poorbarcode added this to the 3.4.0 milestone May 10, 2024
@poorbarcode
poorbarcode requested review from Demogorgon314, Technoboy-, codelipenghui, lhotari, merlimat and rdhabalia May 10, 2024 19:37
@poorbarcode poorbarcode self-assigned this May 10, 2024
@poorbarcode poorbarcode added the release/2.11.5 label May 10, 2024
@github-actions github-actions Bot added the doc-label-missing label May 10, 2024
@github-actions

github-actions Bot commented May 10, 2024

Copy link
Copy Markdown

@poorbarcode Please add the following content to your PR description and select a checkbox:

- [ ] `doc` <!-- Your PR contains doc changes -->
- [ ] `doc-required` <!-- Your PR changes impact docs and you will update later -->
- [ ] `doc-not-needed` <!-- Your PR changes do not impact docs -->
- [ ] `doc-complete` <!-- Docs have been already added -->
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot added doc-not-needed Your PR changes do not impact docs and removed doc-label-missing labels May 10, 2024
Demogorgon314
Demogorgon314 reviewed May 11, 2024
View reviewed changes
Comment thread pulsar-broker-common/src/main/java/org/apache/pulsar/broker/ServiceConfiguration.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

@poorbarcode
poorbarcode requested a review from Demogorgon314 May 11, 2024 08:14
@poorbarcode poorbarcode mentioned this pull request May 11, 2024
[fix] [broker] Fix configurationMetadataSyncEventTopic is marked supporting dynamic setting, but not implemented #22684
Merged
1 of 4 tasks
@lhotari lhotari added release/3.3.2 release/3.0.7 and removed release/3.3.1 release/3.0.5 labels Jul 29, 2024
@lhotari

lhotari commented Jul 29, 2024

Copy link
Copy Markdown
Member

@poorbarcode please resolve the merge conflict

poorbarcode reacted with eyes emoji
All reactions
  • 👀 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

poorbarcode added 3 commits July 30, 2024 00:14
@poorbarcode
[fix] [broker] local metadata sync topic contains configuration event…
921225d
…s causing all operations stuck
@poorbarcode
address comments
20037ed
@poorbarcode
address comment
8a59c50
@poorbarcode
poorbarcode force-pushed the improve/one_zk_4_config_sync branch from 0eb3c04 to 8a59c50 Compare July 29, 2024 16:15
@poorbarcode

poorbarcode commented Jul 29, 2024

Copy link
Copy Markdown
Contributor Author

@lhotari

@poorbarcode please resolve the merge conflict

Done

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@lhotari lhotari added the ready-to-test label Jul 29, 2024
@lhotari lhotari added release/3.3.7 release/4.0.5 and removed release/3.3.6 release/4.0.4 labels Mar 31, 2025
@lhotari lhotari added release/3.0.13 release/3.3.8 release/4.0.6 and removed release/3.0.12 release/3.3.7 release/4.0.5 labels May 20, 2025
@lhotari lhotari added release/3.0.14 release/3.3.9 release/4.0.7 and removed release/3.0.13 release/3.3.8 release/4.0.6 labels Jul 30, 2025
@coderzc coderzc modified the milestones: 4.1.0, 4.2.0 Sep 1, 2025
@lhotari lhotari added release/3.0.15 release/3.3.10 and removed release/3.0.14 release/3.3.9 release/4.0.7 labels Sep 27, 2025
merlimat added 2 commits October 22, 2026 15:43
@merlimat
[fix][broker] Don't swap the local metadata store's synchronizer when…
a2be73e
… configurationMetadataSyncEventTopic is updated on a shared store

When the configuration metadata store URL equals the local one, both use
the same store instance. A dynamic update of
configurationMetadataSyncEventTopic replaced that instance's synchronizer,
so every local metadata write waited on a producer that could never start.

Skip the swap in initConfigMetadataSynchronizerIfNeeded() and reject the
admin update with 412 in that case.

Adopts the fix proposed in apache#22695.
@merlimat
Merge the narrowed shared-store guard on top of master
9b606ae
Replaces the earlier approach (forceUseSeparatedConfigurationStoreInMemory)
with a guard: skip the synchronizer swap and reject the dynamic update of
configurationMetadataSyncEventTopic with 412 when the configuration
metadata store is the same instance as the local one.
@merlimat

merlimat commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

@poorbarcode thanks for finding this. It still reproduces on master: when the local and configuration stores are the same instance, a dynamic configurationMetadataSyncEventTopic replaces the local store's synchronizer in initConfigMetadataSynchronizerIfNeeded(), and every local metadata write then fails with "producer is not started yet".

As part of the open-PR backlog cleanup, I've taken this over and narrowed it to a guard. In that case the broker now skips the swap and the admin update returns 412. There's no new config flag and no second store instance. I merged it on top of your branch (no force push), so your commits are still in the history, and I updated the title and description to match. SyncConfigStoreSharedWithLocalTest covers it. Reviews welcome.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

merlimat
merlimat approved these changes Oct 22, 2026
View reviewed changes
This was referenced Nov 21, 2026
[improve][ci] Run CI for the 4.2.6 backports to branch-4.2 (do not merge) #27680
Closed
[improve][ci] Run CI for the 4.2.6 backports to branch-4.2 (do not merge) #27681
Closed
[improve][ci] Run CI for the 4.2.6 backports to branch-4.2 (do not merge) #27684
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@merlimat merlimat merlimat approved these changes
@lhotari lhotari Awaiting requested review from lhotari
@rdhabalia rdhabalia Awaiting requested review from rdhabalia
@Technoboy- Technoboy- Awaiting requested review from Technoboy-
@codelipenghui codelipenghui Awaiting requested review from codelipenghui
@Demogorgon314 Demogorgon314 Awaiting requested review from Demogorgon314

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@poorbarcode poorbarcode

Labels

cherry-picked/branch-4.0 cherry-picked/branch-4.2 cherry-picked/branch-5.0 doc-not-needed Your PR changes do not impact docs ready-to-test release/4.0.15 release/4.2.6 release/5.0.2 type/bug The PR fixed a bug or issue reported a bug

Projects

None yet

Milestone

5.1.0

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@poorbarcode @lhotari @merlimat @Demogorgon314 @coderzc
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.