Skip to content
Snippets Groups Projects
Commit cd4ed98b authored by Vladimir Davydov's avatar Vladimir Davydov Committed by Konstantin Osipov
Browse files

vinyl: don't use data left from previous vylog records

vy_recovery_iterate() doesn't clean vy_log_record before proceeding to
the next log entry. As a result, a run record passed to the callback by
vy_recovery_iterate() contains extra info left from the index this run
is for: index_lsn, index_id and space_id. We use this in gc and backup
callbacks to format file name. The problem is vy_recovery_iterate() is
also used internally for log rotation. Including extra keys in records
doesn't result in writing them to the log file on rotation, because per
each record type we have a mask of keys corresponding to the record
(vy_log_key_mask). In order to allow optional keys in vylog, the
following patch will change the meaning of the mask so that it only
contains mandatory keys, while a key will be written to the log only if
its value differs from the default (similarly to request_encode). Thus,
to avoid writing keys not relevant to a record type we need to clean
vy_log_record within vy_recovery_iterate() before jumping to the next
record. So this patch weans gc and backup from exploiting this feature -
let them save index_id and space_id in the context, as we do on
replication and recovery.
parent 24707c0c
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment