jineshparakh commented on code in PR #18203:
URL: https://github.com/apache/pinot/pull/18203#discussion_r3108698971
##########
pinot-broker/src/main/java/org/apache/pinot/broker/cursors/FsResponseStore.java:
##########
@@ -163,15 +165,55 @@ protected boolean deleteResponseImpl(String requestId)
pinotFS.delete(queryDir, true);
return true;
} catch (Exception e) {
- // Directory may have been deleted concurrently. If it's gone, treat as
success.
if (!pinotFS.exists(queryDir)) {
LOGGER.debug("Directory already deleted for requestId={} (likely
concurrent deletion)", requestId);
- return true;
+ // synchronized serializes JVM-local calls, but external deletion
(ops, other brokers) can still remove the dir.
+ return false;
}
throw e;
}
}
+ /**
+ * Single-pass optimization: reads each response metadata file once to check
both brokerId and expirationTimeMs,
+ * avoiding the double-read (getAllStoredRequestIds + readResponse) in the
default AbstractResponseStore
Review Comment:
Modified the call. FsResponseStore does not override it now. Introduced
`deleteResponseWithKnownBytes` to save additional read.
##########
pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/CursorIntegrationTest.java:
##########
@@ -368,58 +405,55 @@ public void testQueryWithRuntimeError()
@Test
public void testResponseStoreCleaner()
throws Exception {
Review Comment:
Done
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]