import static com.sleepycat.je.utilint.DbLsn.NULL_LSN;
The ReplicaSyncupReader scans the log backwards for requested log entries.
The reader must track whether it has passed a checkpoint, and therefore
can not used the vlsn index to skip over entries.
The ReplicaSyncupReader is not thread safe, and can only be used
serially. It will stop at the finishLsn, which should be set using the
Set up the ReplicaSyncupReader to start scanning from this VLSN.
("ReplicaSyncupReader start can't be NULL_VLSN");
Backward scanning for the replica's part in syncup.
Backward scanning for finding an earlier candidate syncup matchpoint.
"Restart ReplicaSyncupReader at " +
- an EnvironmentFailureException if we were scanning for a
particular VLSN and we have passed it by.
Return true for ckpt entries, for syncable entries, and if we're in
specific vlsn scan mode, any replicated entry. There is an additional
level of filtering in processEntry.
ProcessEntry does additional filtering before deciding whether to
return an entry as a candidate for matching.
If this is a record we are submitting as a matchpoint candidate,
instantiate a WireRecord to house this log entry. If this is a
non-replicated entry or a txn end that follows the candidate matchpoint,
record whatever status we need to, but don't use it for comparisons.
For example, suppose the log is like this:
-- ckpt end
And that the master only has VLSNs 1-12. The replica will suggest vlsn
14 as the first matchpoint. The feeder will counter with a suggestion
of vlsn 11, since it does not have vlsn 14.
At that point, the ReplicaSyncupReader will scan backwards in the log,
looking for vlsn 11. Although the reader should only return an entry
when it gets to vlsn 11. the reader must process commits and ckpts that
follow 11, so that they can be recorded in the searchResults, so the
number of rolled back commits can be accurately reported.
return (compareResult == 0);
super("Restarting reader in order to read backwards across gap " +
". Reset position to vlsn " + currentVLSN);