fix: bind reclaim deletion threshold as a timestamp, stop swallowing binding errors - #132
Merged
Merged
Conversation
…binding errors listOrphanedFiles() has returned an empty list since #130, so gc() reclaims nothing. #130 moved the reclaim query from a simple statement to a prepared statement. A simple statement carries no column type information, so passing the cutoff as a long worked: a long and a CQL timestamp share the same 8-byte wire format. A prepared statement knows the column type and rejects it with "Codec not found for requested operation: [timestamp <-> java.lang.Long]". #130 also wrapped each partition query in catch (Exception e) with a WARN, so all 24 partitions failed, all 24 were swallowed, and the method returned an empty list on every call. Four tests have failed on master since then: GcTest.gcTest, SimpleIOTest.gc, ChecksumDedupeTest.checksumDupe and ChecksumDedupeTest.checksumDelete. Bind the threshold as a Date, and restore the comment #130 removed that explained why the long was previously safe. Split the catch as well. A codec or type error is a defect that affects every partition, so rethrow it rather than log it. A driver fault on a single partition is still tolerated, because the next gc run retries it, but it now logs at ERROR with the stack trace instead of a WARN carrying only the message. The blanket catch is why this went unnoticed for eleven weeks.
rnc
approved these changes
Sep 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
listOrphanedFiles()has returned an empty list since #130 was merged, sogc()reclaims nothing. Four tests have failed onmasterever since. This restores gc and makes the failure mode loud.What broke
#130 moved the reclaim query from a simple statement to a prepared statement.
A simple statement carries no column type information, so binding the cutoff as a
longworked — alongand a CQLtimestampshare the same 8-byte wire format. The original code documented this:// timestamp data type is encoded as the number of milliseconds since epoch#130 removed that comment and switched to a prepared statement, which does know the column type and rejects the
Long:#130 also wrapped each partition query in
catch (Exception e)with aWARNcarrying onlye.getMessage(). All 24 partitions threw, all 24 were swallowed, and the method returned an empty list. Surefire redirects test output to a file, so the warning never reached the CI console — the build just showed four assertion failures with no visible cause.Failing tests on master
All four are the same defect: gc finds no orphans, so physical files are never deleted.
The fix
Bind the threshold as a
Date, and restore the comment explaining why thelongwas previously safe.Split the catch as well:
CodecNotFoundExceptionorInvalidTypeExceptionis a defect that affects every partition. Rethrow it — swallowing it disables gc silently and lets reclaimable storage grow without bound.DriverExceptionon a single partition is still tolerated, since the next gc run retries it, but it now logs atERRORwith the stack trace rather than aWARNwith only the message.Verification
Full suite, JDK 11,
mvn -B -V clean install -Prun-its -Pci:Codec not foundno longer appears anywhere in the surefire reports, andlistOrphanedFilesnow returns real results (size: 1,size: 2) where every call previously returnedsize: 0.Impact
Not in any release. The newest tag is
path-mapped-3.2(March 30), and #130 landed onmasterafter it, so only3.3-SNAPSHOTconsumers are affected. Anything tracking the snapshot has had no working gc since 2026-06-24 and will have accumulated unreclaimed storage.Backward compatibility
No schema, API or data migration changes.