Fix loading the index of the latest committed log entry
From !6646 (comment 1751269790)
The log entries are stored under keys such as partition/<id>/log/entry/<lsn:uint64>
. Reversing from partition/<id>/log/entry/<0xFF>
would not work if we had a key such as partition/<id>/log/entry/<0xFF>
. Since the keys are encoded in big endian, the uint64 would produce an 8-byte key. We would not find the log entries that have the most significant byte value of 0xFF
. This leads to ignoring log entries past a certain LSN, namely 0xFF00000000000000
or 18374686479671623680.