uint128_t FullMasterCM::commit( const uint32_t incarnation ) { Mutex mutex( _slaves ); #if 0 EQLOG( LOG_OBJECTS ) << "commit v" << _version << " " << command << std::endl; #endif EQASSERT( _version != VERSION_NONE ); _updateCommitCount( incarnation ); if( _object->isDirty( )) { InstanceData* instanceData = _newInstanceData(); instanceData->os.enableCommit( _version + 1, *_slaves ); _object->getInstanceData( instanceData->os ); instanceData->os.disable(); if( instanceData->os.hasSentData( )) { ++_version; EQASSERT( _version != VERSION_NONE ); #if 0 EQINFO << "Committed v" << _version << "@" << _commitCount << ", id " << _object->getID() << std::endl; #endif _addInstanceData( instanceData ); } else _instanceDataCache.push_back( instanceData ); } _obsolete(); return _version; }
uint128_t FullMasterCM::commit( const uint32_t incarnation ) { LBASSERT( _version != VERSION_NONE ); if( !_object->isDirty( )) { Mutex mutex( _slaves ); _updateCommitCount( incarnation ); _obsolete(); return _version; } _maxVersion.waitGE( _version.low() + 1 ); Mutex mutex( _slaves ); #if 0 LBLOG( LOG_OBJECTS ) << "commit v" << _version << " " << command << std::endl; #endif _updateCommitCount( incarnation ); _commit(); _obsolete(); return _version; }
void FullMasterCM::setAutoObsolete( const uint32_t count ) { Mutex mutex( _slaves ); _nVersions = count; _obsolete(); }