- DBG("Data pending for stream id %" PRIu64 " prev_seq %" PRIu64
- " and last_seq %" PRIu64, msg.stream_id,
- stream->prev_seq, msg.last_net_seq_num);
+ if (session_streams_have_index(session)) {
+ /*
+ * Ensure that both the index and stream data have been
+ * flushed up to the requested point.
+ */
+ stream_seq = min(stream->prev_seq, stream->prev_index_seq);
+ } else {
+ stream_seq = stream->prev_seq;
+ }
+ DBG("Data pending for stream id %" PRIu64 ": prev_seq %" PRIu64
+ ", prev_index_seq %" PRIu64
+ ", and last_seq %" PRIu64, msg.stream_id,
+ stream->prev_seq, stream->prev_index_seq,
+ msg.last_net_seq_num);