yezhizi commented on code in PR #3177:
URL: https://github.com/apache/kvrocks/pull/3177#discussion_r2354244420
##########
src/storage/compact_filter.cc:
##########
@@ -132,6 +133,20 @@ bool SubKeyFilter::Filter([[maybe_unused]] int level,
const Slice &key, const Sl
return false;
}
+ if (metadata.Type() == kRedisTimeSeries) {
+ TimeSeriesMetadata ts_metadata(false);
+ Slice input(cached_metadata_);
+ auto s = ts_metadata.Decode(&input);
+ if (!s.ok()) {
+ error("[compact_filter/subkey] Failed to decode timeseries metadata,
namespace: {}, key: {}, err: {}",
+ ikey.GetNamespace(), ikey.GetKey(), s.ToString());
+ return false;
+ }
+ auto timeseries = std::make_unique<redis::TimeSeries>(stor_,
ikey.GetNamespace().ToString());
+ engine::Context ctx(stor_);
+ return timeseries->IsChunkExpired(ctx, ikey.GetKey(), ts_metadata, value);
Review Comment:
In `SubKeyFilter::Filter()`, we should check whether the TS chunk key has
exceeded the retention time. (The code snippet does not yet include a check
for whether it is a TS Chunk. Please ignore this for now.)
--
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]