You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by ti...@apache.org on 2023/05/24 13:56:43 UTC

[pulsar] branch master updated: [fix][broker] Invalidate metadata children cache after key deleted (#20363)

This is an automated email from the ASF dual-hosted git repository.

tison pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar.git


The following commit(s) were added to refs/heads/master by this push:
     new 7dcb3eab291 [fix][broker] Invalidate metadata children cache after key deleted (#20363)
7dcb3eab291 is described below

commit 7dcb3eab2916d42bb58fc1639dc58e11b5230997
Author: 萧易客 <km...@live.com>
AuthorDate: Wed May 24 21:56:30 2023 +0800

    [fix][broker] Invalidate metadata children cache after key deleted (#20363)
---
 .../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);