You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by zh...@apache.org on 2023/05/31 08:50:44 UTC

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

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

zhaocong pushed a commit to branch branch-2.9
in repository https://gitbox.apache.org/repos/asf/pulsar.git


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

commit 45aa84ca01eeb16f0cc6014544c7277211d80493
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 561af0196ca..e1fec86479f 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
@@ -185,6 +185,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);
@@ -208,6 +209,7 @@ public abstract class AbstractMetadataStore implements MetadataStoreExtended, Co
         return storeDelete(path, expectedVersion)
                 .thenRun(() -> {
                     existsCache.synchronous().invalidate(path);
+                    childrenCache.synchronous().invalidate(path);
                     String parent = parent(path);
                     if (parent != null) {
                         childrenCache.synchronous().invalidate(parent);