github-actions[bot] commented on code in PR #68310:
URL: https://github.com/apache/doris/pull/68310#discussion_r4060319327
##########
be/src/io/cache/cached_remote_file_reader.cpp:
##########
@@ -1078,6 +1078,7 @@ Status
CachedRemoteFileReader::_read_from_indirect_cache(size_t offset, Slice re
s_align_size(offset + already_read, bytes_req - already_read,
size());
CacheContext cache_context(io_ctx);
cache_context.stats = &stats;
+ cache_context.tablet_id = _tablet_id;
Review Comment:
[P2] Reconcile blocks added after TTL promotion
This newly routes synchronous positive-ID blocks into the TTL manager, but
`register_tablet_id()` only adds the ID to its deduplicated set and does not
invalidate `TtlInfo::blocks_promoted`. `SegmentIndexFileCacheLoader` is a
concrete caller: it forces a synchronous/dry-run INDEX read without an
expiration, so after an earlier active-TTL promotion the new block is
registered yet skipped by the `want_ttl && blocks_promoted` early return for
the rest of that interval, including extensions. Registration also precedes
append/finalize metadata publication, so the first scan can see no row and mark
promotion complete before the block becomes durable. Please invalidate
promotion at the durable publication boundary or otherwise make it
level-triggered, and cover both late publication and the
register-before-finalize ordering.
##########
be/src/io/cache/cached_remote_file_reader.cpp:
##########
@@ -121,7 +121,7 @@
CachedRemoteFileReader::CachedRemoteFileReader(FileReaderSPtr remote_file_reader
: _is_doris_table(opts.is_doris_table),
_cache_align_mode(opts.align_mode),
_cache_write_mode(opts.cache_write_mode),
- _tablet_id(opts.tablet_id),
+ _tablet_id(opts.is_doris_table ? opts.tablet_id : 0),
Review Comment:
[P2] Migrate legacy tablet-ID metadata keys
This normalization and the synchronous assignment below change two
persistent `BlockMetaKey` namespaces: old async external blocks were written
under `-1` and now use `0`, while old sync Doris blocks were written under `0`
and now use the positive tablet ID. Direct loading performs only an exact
`(tablet_id, hash, offset)` lookup, and background duplicate handling only
mutates the in-memory ID; loader-first therefore retains the legacy identity,
while reader-first can leave an alternate row that survives single-key eviction
and is restored later for a missing file. Please reconcile this context-aware:
migrate external `-1` to `0`, migrate legacy `0` to a positive ID only when a
Doris reader supplies that identity, atomically update the live cell using the
cache/block lock order, delete the old row, and cover both startup orderings
through eviction and restart.
--
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]