diff --git a/apps/emqx_durable_storage/src/emqx_ds_storage_skipstream_lts.erl b/apps/emqx_durable_storage/src/emqx_ds_storage_skipstream_lts.erl index bb786c1f0..f555241f2 100644 --- a/apps/emqx_durable_storage/src/emqx_ds_storage_skipstream_lts.erl +++ b/apps/emqx_durable_storage/src/emqx_ds_storage_skipstream_lts.erl @@ -101,7 +101,9 @@ -record(it, { static_index :: emqx_ds_lts:static_key(), + %% Minimal timestamp of the next message: ts :: ts(), + %% Compressed topic filter: compressed_tf :: binary() }). @@ -555,8 +557,16 @@ next_step( next_step(S, StaticIdx, CompressedTF, Iterators, NextTS, {seek, NextTS}) end; NextTS when NextTS > ExpectedTS, N > 0 -> + %% Next index level is not what we expect. Reset + %% search to the first wilcard index, but continue + %% from `NextTS'. + %% + %% Note: if `NextTS > ExpectedTS' and `N =:= 0', + %% it means the upper (replication) level is + %% broken and supplied us NextTS that advenced + %% past the point of time that can be safely read. + %% We don't handle it here. inc_counter(?DS_SKIPSTREAM_LTS_MISS), - %% Next index level is not what we expect. {seek, NextTS} end end. diff --git a/changes/ce/feat-13370.en.md b/changes/ce/feat-13370.en.md index a44f94eea..8ed0cc75e 100644 --- a/changes/ce/feat-13370.en.md +++ b/changes/ce/feat-13370.en.md @@ -2,8 +2,6 @@ Add a new version of `wildcard_optimized` storage layout for the durable storage Improvements: -- New layout does not introduce latency +- New layout does not have an inherent latency -- On-disk serialization of MQTT messages is much more efficient - - Metadata is encoded more efficiently - - Message topic is compressed +- MQTT messages are serialized into a much more space-efficient format