This bugs needed two conditions to appear:
- the input needs to be highly compressible so that there are collisions in the chain table used for finding references backwards in the stream,
- the start offset needs to be > 0.
CompressingStoredFieldFormat only calls LZ4.compress(HC) with positive start offsets since
LUCENE-5188 so this shouldn't have impact on people who were using CompressionMode.FAST_DECOMPRESSION (which seems to be confirmed by the fact that we never saw any test failure related to this until today, only a few minutes after I committed LUCENE-5188).
I was able to write a test case that reproduces the bug and changed the existing tests so that they don't only test compression with a start offset of 0.