vaijosh commented on code in PR #7685:
URL: https://github.com/apache/hbase/pull/7685#discussion_r2740009421


##########
hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/bucket/BucketCache.java:
##########
@@ -1755,6 +1755,13 @@ private void retrieveChunkedBackingMap(FileInputStream 
in) throws IOException {
     BucketCacheProtos.BucketCacheEntry cacheEntry =
       BucketCacheProtos.BucketCacheEntry.parseDelimitedFrom(in);
 
+    // HBASE-29857: Handle case where persistence file is empty or corrupted.
+    // parseDelimitedFrom() returns null when there's no data to read.
+    if (cacheEntry == null) {

Review Comment:
   @teamconfx 
   I noticed one more potential NPE in BucketCache.retrieveFromFile e.g. when 
ProtobufMagic.isPBMagicPrefix(pbuf)=true. 
   
   So can we validation check in the caller, BucketCache.retrieveFromFile to 
check if the persistence file is empty or corrupted?



-- 
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