smiklosovic commented on code in PR #3203:
URL: https://github.com/apache/cassandra/pull/3203#discussion_r1537741233
##########
src/java/org/apache/cassandra/hints/HintsStore.java:
##########
@@ -111,17 +117,37 @@ PendingHintsInfo getPendingHintsInfo()
int queueSize = 0;
long minTimestamp = Long.MAX_VALUE;
long maxTimestamp = Long.MIN_VALUE;
+ long totalSize = 0;
while (descriptors.hasNext())
{
HintsDescriptor descriptor = descriptors.next();
minTimestamp = Math.min(minTimestamp, descriptor.timestamp);
maxTimestamp = Math.max(maxTimestamp, descriptor.timestamp);
+ totalSize += descriptor.hintsFileSize(hintsDirectory);
queueSize++;
}
- if (queueSize == 0)
+ int corruptedFilesCount = 0;
+ long corruptedFilesSize = 0;
+
+ Iterator<HintsDescriptor> corruptedDescriptors =
corruptedFiles.iterator();
+ while (corruptedDescriptors.hasNext())
+ {
+ HintsDescriptor corruptedDescriptor = corruptedDescriptors.next();
+ try
+ {
+ corruptedFilesSize +=
corruptedDescriptor.hintsFileSize(hintsDirectory);
+ } catch (Exception ex)
+ {
+ // ignore
Review Comment:
the logic behind this is that if a descriptor was added among corrupted, it
was do so in a catch, so it is probable that if we ask its size it would throw
again, just to be super super we do not ruin whole query, lets just wrap it in
a try-catch
--
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]