From bc69fd7f115fe86451e5ccf1cf6ea082219aea7d Mon Sep 17 00:00:00 2001 From: Piotr Szymaniak Date: Wed, 6 May 2026 11:04:22 +0200 Subject: [PATCH] alternator/streams: remove dead next_iter in get_records MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The variable was constructed but never used — the original iterator is returned instead. Fix the misleading comment to explain the open-shard semantics of returning the original iterator. --- alternator/streams.cc | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/alternator/streams.cc b/alternator/streams.cc index 81e1d555e2..f41c742283 100644 --- a/alternator/streams.cc +++ b/alternator/streams.cc @@ -1531,11 +1531,8 @@ future executor::get_records(client_state& client // "set to null". Our test test_streams_closed_read // confirms that by "null" they meant not set at all. } else { - // We could have return the same iterator again, but we did - // a search from it until high_ts and found nothing, so we - // can also start the next search from high_ts. - // TODO: but why? It's simpler just to leave the iterator be. - shard_iterator next_iter(iter.table, iter.shard, utils::UUID_gen::min_time_UUID(high_ts.time_since_epoch()), true); + // Shard is still open with no records in the scanned window. + // Return the original iterator so the client can poll again. rjson::add(ret, "NextShardIterator", iter); } _stats.api_operations.get_records_latency.mark(std::chrono::steady_clock::now() - start_time);