Stream: Handle streamID-related edge cases

This commit solves several edge cases that are related to
exhausting the streamID limits: We should correctly calculate
the succeeding streamID instead of blindly incrementing 'seq'
This affects both XREAD and XADD.

Other (unrelated) changes:
Reply with a better error message when trying to add an entry
to a stream that has exhausted last_id
This commit is contained in:
Guy Benoish
2019-12-26 15:31:37 +05:30
committed by antirez
parent 52ea44e53b
commit cddf1da2e9
4 changed files with 54 additions and 4 deletions

View File

@ -111,5 +111,6 @@ streamNACK *streamCreateNACK(streamConsumer *consumer);
void streamDecodeID(void *buf, streamID *id);
int streamCompareID(streamID *a, streamID *b);
void streamFreeNACK(streamNACK *na);
void streamIncrID(streamID *id);
#endif