Repository navigation
Adapt file-scoped TsFile contexts and resource lifecycles - #18999
Conversation
|
Pipe aligned-chunk retry can reuse chunks already closed by a failed reader constructorIn
The pending group therefore still references value chunks whose page-AEAD references have already been released. If the exception is a classified memory-pressure exception, the code marks Suggested fix: do not leave the original borrowed chunk list in |
|
@shuwenwei Thanks for checking the failure paths. Regarding the double-close comment, I checked both the sources and bytecode of the exact dependency used here,
synchronized (this) {
if (destroyed) {
return;
}
destroyed = true;
// ...
}
if (fileEncryptContext != null) {
fileEncryptContext.release();
}Also, So the constructor/registry cleanup and the loader's catch block can indeed both close the same chunk, but the second close does not decrement the shared reference count again. In this dependency version, repeated close is redundant cleanup; it does not over-release the context or invalidate other retained references. This addresses the double-close/reference-count claim specifically. Reusing an already-closed object during a retry is a separate ownership question. |
Retain independent aligned chunks and buffer views for each reader construction attempt so failed attempts do not invalidate pending groups. Release pending value chunk references after successful construction. Propagate the recovered writer context to initial and snapshot recovery memtables. Cover constructor failure retries, partial retain cleanup, and aligned/non-aligned WAL insert and snapshot recovery.
Description
Upgrade TsFile to
2.5.1-261023-SNAPSHOTand adapt the storage/query integration to its file-scoped encryption contexts. This PR adds reusable integration points only; it does not add a crypto implementation, wallet, key manager, WAL encryption, or a new user configuration option.Reader APIs and Resource Ownership
Per-File Writing and Rewrite Policy
FileEncryptionParameterProviderSPI. The default uses the existing legacy parameters unchanged. No production provider is bundled. Ambiguous providers and a custom provider returning null fail explicitly.Verification
RepairUnsortedFileCompactionTest/RepairUnsortedFileSchedulerTestclasses. Existing plain-file Fast/ReadChunk cases are also run as regressions, not as encrypted-format support tests.git diff --check.No running-cluster integration test was executed for this PR.
This PR has:
Key Changed/Added Classes
FileEncryptionParameterProvider,EncryptDBUtils,QueryChunkReaders,ChunkCache,DiskChunkLoader,DiskAlignedChunkLoader,CompactionTsFileWriter,AbstractCompactionWriter,TabletRewriteLoadStrategy, and TsFile-based Pipe/Load readers.