You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by yu...@apache.org on 2023/05/30 12:18:47 UTC
[pulsar] branch branch-3.0 updated: [fix][broker] Invalidate metadata children cache after key deleted (#20363)
This is an automated email from the ASF dual-hosted git repository.
yubiao pushed a commit to branch branch-3.0
in repository https://gitbox.apache.org/repos/asf/pulsar.git
The following commit(s) were added to refs/heads/branch-3.0 by this push:
new a1feb97c13a [fix][broker] Invalidate metadata children cache after key deleted (#20363)
a1feb97c13a is described below
commit a1feb97c13a14dfd42cf4e70de58afeff63fb00d
Author: 萧易客 <km...@live.com>
AuthorDate: Wed May 24 21:56:30 2023 +0800
[fix][broker] Invalidate metadata children cache after key deleted (#20363)
(cherry picked from commit 7dcb3eab2916d42bb58fc1639dc58e11b5230997)
---
.../java/org/apache/pulsar/metadata/impl/AbstractMetadataStore.java | 2 ++
1 file changed, 2 insertions(+)
diff --git a/pulsar-metadata/src/main/java/org/apache/pulsar/metadata/impl/AbstractMetadataStore.java b/pulsar-metadata/src/main/java/org/apache/pulsar/metadata/impl/AbstractMetadataStore.java
index 072d513cca9..6fcf8eb6b49 100644
--- a/pulsar-metadata/src/main/java/org/apache/pulsar/metadata/impl/AbstractMetadataStore.java
+++ b/pulsar-metadata/src/main/java/org/apache/pulsar/metadata/impl/AbstractMetadataStore.java
@@ -328,6 +328,7 @@ public abstract class AbstractMetadataStore implements MetadataStoreExtended, Co
if (type == NotificationType.Created || type == NotificationType.Deleted) {
existsCache.synchronous().invalidate(path);
+ childrenCache.synchronous().invalidate(path);
String parent = parent(path);
if (parent != null) {
childrenCache.synchronous().invalidate(parent);
@@ -385,6 +386,7 @@ public abstract class AbstractMetadataStore implements MetadataStoreExtended, Co
// Ensure caches are invalidated before the operation is confirmed
return storeDelete(path, expectedVersion).thenRun(() -> {
existsCache.synchronous().invalidate(path);
+ childrenCache.synchronous().invalidate(path);
String parent = parent(path);
if (parent != null) {
childrenCache.synchronous().invalidate(parent);