Skip to content

Conversation

@poorbarcode
Copy link
Contributor

@poorbarcode poorbarcode commented Aug 20, 2025

Motivation

Background

  • Users may start 2 clusters with the Geo-Replication feature with Global ZK
  • Users want to hire one cluster, so remove the cluster from namespace-level replicatedClusters
    • Broker will remove the topics because the cluster was removed.
  • Issue occurs:
    • User topics can not be deleted anymore, because the operation delete data from transaction buffer can not be executed successfully anymore, and will get an error "Namespace missing local cluster name in clusters list". Because the topic __transaction_buffer_snapshot can not be accessed anymore since the cluster was removed.
    • The task topic.checkReplication and other operations will retry again and again, as a result, the broker will crash of OOM

Modifications

  • Do not create the transaction buffer component for transaction system topics.
  • Remove the system topic __transaction_buffer_snapshot if it is not allowed to be accessed(removed current cluster from allowed cluster)
  • Skip removing topic-level policies if the system topic __transaction_buffer_snapshot has been deleted.

Documentation

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

Matching PR in forked repository

PR in forked repository: x

@poorbarcode poorbarcode added this to the 4.1.0 milestone Aug 20, 2025
@poorbarcode poorbarcode self-assigned this Aug 20, 2025
@poorbarcode poorbarcode added type/bug The PR fixed a bug or issue reported a bug release/4.0.7 labels Aug 20, 2025
@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Aug 20, 2025
@poorbarcode
Copy link
Contributor Author

/pulsarbot rerun-failure-checks

@poorbarcode poorbarcode requested a review from coderzc August 28, 2025 12:22
@poorbarcode poorbarcode force-pushed the fix/txn_buffer_pervents_topic_deletion_after_removed_cluster branch from 0fbc09c to b74b510 Compare August 28, 2025 13:00
@poorbarcode
Copy link
Contributor Author

The test PartitionCreationTest.testCreateMissedPartitions is flaky. I have pushed another PR to fix it. Please ignore it

@poorbarcode poorbarcode force-pushed the fix/txn_buffer_pervents_topic_deletion_after_removed_cluster branch from b74b510 to d3d49f2 Compare August 29, 2025 02:14
@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 86.27451% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.14%. Comparing base (490ba0c) to head (d3d49f2).
⚠️ Report is 5 commits behind head on master.

Files with missing lines Patch % Lines
...r/impl/SnapshotSegmentAbortedTxnProcessorImpl.java 75.00% 2 Missing and 2 partials ⚠️
...sar/broker/service/persistent/PersistentTopic.java 81.81% 0 Missing and 2 partials ⚠️
.../apache/pulsar/common/naming/SystemTopicNames.java 80.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff              @@
##             master   #24648       +/-   ##
=============================================
+ Coverage     38.72%   74.14%   +35.42%     
- Complexity    13076    33375    +20299     
=============================================
  Files          1836     1893       +57     
  Lines        143697   147811     +4114     
  Branches      16616    17098      +482     
=============================================
+ Hits          55650   109598    +53948     
+ Misses        80600    29450    -51150     
- Partials       7447     8763     +1316     
Flag Coverage Δ
inttests 26.65% <15.68%> (+0.01%) ⬆️
systests 22.73% <7.84%> (+0.01%) ⬆️
unittests 73.63% <86.27%> (+38.98%) ⬆️

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

Files with missing lines Coverage Δ
.../pulsar/broker/service/persistent/SystemTopic.java 85.71% <100.00%> (+1.50%) ⬆️
...er/systopic/NamespaceEventsSystemTopicFactory.java 100.00% <100.00%> (+26.66%) ⬆️
...er/impl/SingleSnapshotAbortedTxnProcessorImpl.java 84.26% <100.00%> (+36.07%) ⬆️
.../apache/pulsar/common/naming/SystemTopicNames.java 78.26% <80.00%> (+6.03%) ⬆️
...sar/broker/service/persistent/PersistentTopic.java 79.24% <81.81%> (+26.13%) ⬆️
...r/impl/SnapshotSegmentAbortedTxnProcessorImpl.java 81.20% <75.00%> (+81.20%) ⬆️

... and 1388 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.

Copy link
Member

@coderzc coderzc left a comment

Choose a reason for hiding this comment

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

LGTM

@Technoboy- Technoboy- merged commit 66b69ad into apache:master Aug 29, 2025
51 checks passed
Technoboy- pushed a commit that referenced this pull request Sep 10, 2025
…e of failed delete data from transaction buffer topic (#24648)
manas-ctds pushed a commit to datastax/pulsar that referenced this pull request Sep 12, 2025
…e of failed delete data from transaction buffer topic (apache#24648)

(cherry picked from commit 5f1c540)
nborisov pushed a commit to nborisov/pulsar that referenced this pull request Sep 12, 2025
…e of failed delete data from transaction buffer topic (apache#24648)
srinath-ctds pushed a commit to datastax/pulsar that referenced this pull request Sep 12, 2025
…e of failed delete data from transaction buffer topic (apache#24648)

(cherry picked from commit 5f1c540)
KannarFr pushed a commit to CleverCloud/pulsar that referenced this pull request Sep 22, 2025
…e of failed delete data from transaction buffer topic (apache#24648)
walkinggo pushed a commit to walkinggo/pulsar that referenced this pull request Oct 8, 2025
…e of failed delete data from transaction buffer topic (apache#24648)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants