#
278f3c5d |
| 18-Mar-2020 |
James Harrison <00jamesh@gmail.com> |
MB-38327: Interpret access logs written before mad-hatter correctly An issue was encountered during offline upgrade from 5.0.1 to 6.5.0. It was found to be while reading the access log f
MB-38327: Interpret access logs written before mad-hatter correctly An issue was encountered during offline upgrade from 5.0.1 to 6.5.0. It was found to be while reading the access log for the first time after the upgrade. This process requires 6.5.0 to read a older version of the access log format (containing MutationLogEntryV2 rather than the current, V3). SerialisedDocKey was changed in 6.5.0 to treat the namespace prefix as part of the key, rather than as a separate byte. This required a compensatory change in MutationLogEntryV2 in 6.5.0, however there was a small bug in how this was done; the struct was padded by an additional byte, ensuring the key bytes started at the same offset in the LogEntry, but this _also_ shifted the offset of the length field. This lead to 6.5.0 expecting to find the key length field one byte later than it should - this caused it to read the docNamespace and treat it as the length. This was always 0 prior to mad-hatter, so the key was treated as zero length. However - when "upgrading" the V2 struct to V3 to use it, the code expected to strip a 1 byte prefix from the key (the docNamespace). i.e., start + 1, length - 1. This lead to an underflow, and the V3 struct constructor copied the key and read/wrote past the end of allocated memory. Fixed by introducing a LegacySerialisedDocKey, which has the previous layout. Change-Id: I53e8491fd8afa7927d069904e19b3502ecbdd072 Reviewed-on: http://review.couchbase.org/123930 Well-Formed: Build Bot <build@couchbase.com> Reviewed-by: Dave Rigby <daver@couchbase.com> Tested-by: Build Bot <build@couchbase.com> Reviewed-by: Jim Walker <jim@couchbase.com>
show more ...
|