Description
This was found by this build failure: http://jenkins.thetaphi.de/job/Lucene-Solr-5.x-Linux/15210/
If the doc count is a multiple of 65534 minus one and the segment is storing binary, sorted set or sorted numeric doc values then you may hit an error when reading values that is due to an off-by-one error in Lucene54DocValuesProducer. This was introduced in LUCENE-6840.
I'll upload a patch shortly.