Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
1.7.3, 1.8.1, 1.9.1, 1.11.0, 1.10.1, 1.12.0
-
None
Description
LevelDB keys used by LevelDBStorage are uint64_t log positions encoded as strings and padded with zeroes up to a certain fixed size. The encode() function is incorrect because it uses the %d formatter that expects an int. It also limits the key size to 10 digits which is OK for UINT32_MAX but isn't enough for UINT64_MAX.
Because of this the available key range is reduced, and key overflow can result in replica's METADATA record (position 0) being overwritten, which in turn may cause data loss.