com.sleepycat.je.rep.impl.node
Class GlobalCBVLSN
java.lang.Object
com.sleepycat.je.rep.impl.node.GlobalCBVLSN
class GlobalCBVLSN
- extends Object
Represents this node's view of the global CBVLSN. Each node has its own view
of the global CBVLSN, based upon its local replicated copy of the rep group
db. There is a single instance of the GlobalCBVLSN and it exists for the
lifetime of the RepNode.
A global CBVLSN is a per-environment value, and is safeguarded from
decreasing during the lifetime of a single RepImpl. Because nodes crash and
re-sync, and new nodes join, it's possible that the persisted local cbvlsns
can decrease, and drag the global cbvlsn value down, but those decreases
are ignored during the lifetime of the global CBVLSN instance.
The global CBVLSN is used by:
1. The Cleaner
2. The Feeder which only serves log records in the interval:
[GlobalCBVLSN .. VLSNRange.last]
3. The Replica which uses the interval [GlobalCBVLSN .. VLSNRange.last] at
syncup time.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
GlobalCBVLSN
GlobalCBVLSN(RepNode repNode)
getCBVLSN
VLSN getCBVLSN()
syncupStarted
void syncupStarted()
syncupEnded
void syncupEnded()
getCleanerBarrierFile
long getCleanerBarrierFile()
throws DatabaseException
- Returns the file number that forms a barrier for the cleaner's file
deletion activities. Files with numbers >= this file number cannot be
by the cleaner without disrupting the replication stream.
- Returns:
- the file number that's the barrier for cleaner file deletion
- Throws:
DatabaseException
recalculate
void recalculate(RepGroupImpl groupInfo)
- Recalculate the cached, global CBVLSN. The globalCBVLSN is computed as
the minimum of CBVLSNs after discarding CBVLSNs that are obsolete. A
CBVLSN is considered obsolete, if it has not been updated within a
configurable time interval relative to the time that the most recent
CBVLSN was updated.
Note that the read of GroupInfo is not protected, and that groupInfo
could be changing. That's okay, because we guarantee that none of the
local CBVLSNs can be set to be LT globalCBVLSN. If a local CBVLSN is
written, and we miss it, it only means that this recalcuation of global
CBVLSN is too pessimistic -- it's too low.
The low range of the VLSNIndex may be LTE the GlobalCBVLSN. The
VLSNIndex is only truncated when a log file is actually deleted. This
separates the cost of the Global CBVLSN recalculation from the cost of
the VLSNIndex truncation, sinc the latter may require I/O. This also
makes it easier and cheaper to obey the rule that the VLSNIndex
truncation only occur on bucket boundaries.
Copyright (c) 2004-2012 Oracle. All rights reserved.