Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix][broker] Fix ResourceGroups loading #21781

Merged
merged 1 commit into from Mar 26, 2024

Conversation

nodece
Copy link
Member

@nodece nodece commented Dec 21, 2023

Motivation

When the Pulsar starts up, the ResourceGroupConfigListener.java and ResourceGroupNamespaceConfigListener.java cache ResourceGroup and Namespace resources into memory for binding relationships. But this cache is loaded asynchronously, causing Namespace sometimes unable to find ResourceGroup.

2023-12-21T09:41:18,749+0000 [ForkJoinPool.commonPool-worker-2] ERROR org.apache.pulsar.broker.resourcegroup.ResourceGroupNamespaceConfigListener - Failed to register namespace my-tenant/my-namespace with resource group rg-1
org.apache.pulsar.client.admin.PulsarAdminException: Resource group does not exist: rg-1
        at org.apache.pulsar.broker.resourcegroup.ResourceGroupService.checkResourceGroupExists(ResourceGroupService.java:417) ~[org.apache.pulsar-pulsar-broker-3.1.1.jar:3.1.1]
        at org.apache.pulsar.broker.resourcegroup.ResourceGroupService.registerNameSpace(ResourceGroupService.java:249) ~[org.apache.pulsar-pulsar-broker-3.1.1.jar:3.1.1]
        at org.apache.pulsar.broker.resourcegroup.ResourceGroupNamespaceConfigListener.reconcileNamespaceResourceGroup(ResourceGroupNamespaceConfigListener.java:127) ~[org.apache.pulsar-pulsar-broker-3.1.1.jar:3.1.1]
        at org.apache.pulsar.broker.resourcegroup.ResourceGroupNamespaceConfigListener.lambda$updateNamespaceResourceGroup$0(ResourceGroupNamespaceConfigListener.java:69) ~[org.apache.pulsar-pulsar-broker-3.1.1.jar:3.1.1]
        at java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:863) ~[?:?]
        at java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:841) ~[?:?]
        at java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:483) ~[?:?]
        at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373) ~[?:?]
        at java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182) ~[?:?]
        at java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655) ~[?:?]
        at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622) ~[?:?]
        at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165) ~[?:?]

Modifications

  • Wait for ResourceGroup to load into memory, then create ResourceGroupNamespaceConfigListener
  • Add retry for loading ResourceGroup

Verifying this change

Added.

Documentation

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

@nodece nodece changed the title [fix][broker] Fix resourceGroups loading [fix][broker] Fix ResourceGroups loading Dec 21, 2023
@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Dec 21, 2023
@nodece
Copy link
Member Author

nodece commented Dec 21, 2023

/pulsarbot rerun-failure-checks

@Technoboy- Technoboy- modified the milestones: 3.2.0, 3.3.0 Dec 22, 2023
@lhotari
Copy link
Member

lhotari commented Dec 22, 2023

/pulsarbot rerun-failure-checks

2 similar comments
@nodece
Copy link
Member Author

nodece commented Dec 23, 2023

/pulsarbot rerun-failure-checks

@nodece
Copy link
Member Author

nodece commented Dec 24, 2023

/pulsarbot rerun-failure-checks

@codecov-commenter
Copy link

codecov-commenter commented Dec 24, 2023

Codecov Report

Attention: Patch coverage is 89.18919% with 4 lines in your changes are missing coverage. Please review.

Project coverage is 73.65%. Comparing base (bbc6224) to head (68bb959).
Report is 75 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #21781      +/-   ##
============================================
+ Coverage     73.57%   73.65%   +0.08%     
+ Complexity    32624    32197     -427     
============================================
  Files          1877     1887      +10     
  Lines        139502   139502              
  Branches      15299    15293       -6     
============================================
+ Hits         102638   102754     +116     
+ Misses        28908    28783     -125     
- Partials       7956     7965       +9     
Flag Coverage Δ
inttests 26.86% <40.54%> (+2.28%) ⬆️
systests 24.38% <40.54%> (+0.05%) ⬆️
unittests 72.93% <89.18%> (+0.08%) ⬆️

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

Files Coverage Δ
...sar/broker/resourcegroup/ResourceGroupService.java 73.36% <100.00%> (-0.20%) ⬇️
...ker/resourcegroup/ResourceGroupConfigListener.java 83.14% <88.88%> (+5.68%) ⬆️

... and 175 files with indirect coverage changes

@Technoboy-
Copy link
Contributor

Technoboy- commented Dec 26, 2023

Add related issue #15113 and related fix #15126

@nodece
Copy link
Member Author

nodece commented Jan 15, 2024

#15126 has been closed, so this PR needs to be reviewed again.

@nodece
Copy link
Member Author

nodece commented Mar 8, 2024

The comment has been resolved and can be reviewed again.

@nodece
Copy link
Member Author

nodece commented Mar 22, 2024

/pulsarbot rerun-failure-checks

Signed-off-by: Zixuan Liu <nodeces@gmail.com>
@nodece
Copy link
Member Author

nodece commented Mar 25, 2024

/pulsarbot rerun-failure-checks

@nodece nodece merged commit 80b491d into apache:master Mar 26, 2024
49 of 50 checks passed
nodece added a commit that referenced this pull request Mar 26, 2024
Signed-off-by: Zixuan Liu <nodeces@gmail.com>
(cherry picked from commit 80b491d)
nodece added a commit that referenced this pull request Mar 26, 2024
Signed-off-by: Zixuan Liu <nodeces@gmail.com>
(cherry picked from commit 80b491d)
nodece added a commit that referenced this pull request Mar 26, 2024
Signed-off-by: Zixuan Liu <nodeces@gmail.com>
(cherry picked from commit 80b491d)
nodece added a commit that referenced this pull request Mar 26, 2024
Signed-off-by: Zixuan Liu <nodeces@gmail.com>
(cherry picked from commit 80b491d)
Technoboy- pushed a commit to Technoboy-/pulsar that referenced this pull request Apr 1, 2024
Signed-off-by: Zixuan Liu <nodeces@gmail.com>
nikhil-ctds pushed a commit to datastax/pulsar that referenced this pull request Apr 3, 2024
Signed-off-by: Zixuan Liu <nodeces@gmail.com>
(cherry picked from commit 80b491d)
(cherry picked from commit dfb1a67)
nikhil-ctds pushed a commit to datastax/pulsar that referenced this pull request Apr 4, 2024
Signed-off-by: Zixuan Liu <nodeces@gmail.com>
(cherry picked from commit 80b491d)
(cherry picked from commit dfb1a67)
nodece added a commit to ascentstream/pulsar that referenced this pull request May 13, 2024
Signed-off-by: Zixuan Liu <nodeces@gmail.com>
(cherry picked from commit 80b491d)
nodece added a commit to ascentstream/pulsar that referenced this pull request May 15, 2024
Signed-off-by: Zixuan Liu <nodeces@gmail.com>
(cherry picked from commit 80b491d)
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.

None yet

6 participants