swuferhong commented on code in PR #3511:
URL: https://github.com/apache/fluss/pull/3511#discussion_r3491857633


##########
fluss-server/src/main/java/org/apache/fluss/server/RpcServiceBase.java:
##########
@@ -634,6 +651,12 @@ protected MetadataResponse processMetadataRequest(
                 if (partitionIdAndPaths.containsKey(partitionId)) {
                     partitionPaths.add(partitionIdAndPaths.get(partitionId));
                 } else {
+                    // Only cache when the authoritative partition assignment 
is also gone. A miss
+                    // from the scoped table-path lookup may simply mean that 
the request omitted
+                    // the owning table or the session is not authorized for 
it.
+                    if (isPartitionAssignmentMissingFromZk(partitionId)) {

Review Comment:
   Thanks for the comment. `partitionIdsNotExistsInCache` indeed does not 
include IDs already hit by the negative cache.
   The extra `isPartitionAssignmentMissingFromZk(partitionId)` check is still 
needed before markNonExistent, because 
`getPartitionIdAndPaths(authorizedTables)` is scoped by the 
requested/authorized table paths. A miss there may mean the partition belongs 
to another table or is not visible in this request scope, rather than globally 
non-existent.
   I addressed the mirror case by invalidating stale negative-cache entries 
when we confirm the partition exists:
   metadata cache hit: call `partitionNegativeCache.markExistent(partitionId)`
   ZK partitionIdAndPaths hit: call 
`partitionNegativeCache.markExistent(partitionId)`
   This keeps the negative cache effective for real non-existent partitions 
while avoiding stale negative entries blocking existing partitions.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to