Buggy code:
protected final ArrayBlockingQueue < OAsynchDistributedOperation > asynchronousOperationsQueue ; protected final Thread asynchWorker ; protected volatile boolean running = true ; public ODistributedStorage ( final OServer iServer , final OAbstractPaginatedStorage wrapped ) { } @ Override public boolean isDistributed ( ) { } @ Override public boolean isAssigningClusterIds ( ) { } @ Override public Class < ? extends OSBTreeCollectionManager > getCollectionManagerClass ( ) { } public Object command ( final OCommandRequestText iCommand ) { } public OStorageOperationResult < OPhysicalPosition > createRecord ( final ORecordId iRecordId , final byte [ ] iContent , final ORecordVersion iRecordVersion , final byte iRecordType , final int iMode , final ORecordCallback < Long > iCallback ) { } public OStorageOperationResult < ORawBuffer > readRecord ( final ORecordId iRecordId , final String iFetchPlan , final boolean iIgnoreCache , final ORecordCallback < ORawBuffer > iCallback , final boolean loadTombstones , LOCKING_STRATEGY iLockingStrategy ) { } @ Override public OStorageOperationResult < ORecordVersion > updateRecord ( final ORecordId iRecordId , final boolean updateContent , final byte [ ] iContent , final ORecordVersion iVersion , final byte iRecordType , final int iMode , final ORecordCallback < ORecordVersion > iCallback ) { } @ Override public OStorageOperationResult < Boolean > deleteRecord ( final ORecordId iRecordId , final ORecordVersion iVersion , final int iMode , final ORecordCallback < Boolean > iCallback ) { } @ Override public OStorageOperationResult < Boolean > hideRecord ( ORecordId recordId , int mode , ORecordCallback < Boolean > callback ) { } @ Override public ORecordMetadata getRecordMetadata ( ORID rid ) { } @ Override public boolean cleanOutRecord ( ORecordId recordId , ORecordVersion recordVersion , int iMode , ORecordCallback < Boolean > callback ) { } @ Override public boolean existsResource ( final String iName ) { } public OCluster getClusterByName ( final String iName ) { } @ Override public ORecordConflictStrategy getConflictStrategy ( ) { } @ Override public void setConflictStrategy ( final ORecordConflictStrategy iResolver ) { } @ Override @ SuppressWarnings ( "unchecked" ) public < T > T removeResource ( final String iName ) { } @ Override public < T > T getResource ( final String iName , final Callable < T > iCallback ) { } @ Override public void open ( final String iUserName , final String iUserPassword , final Map < String , Object > iProperties ) { } @ Override public void create ( final Map < String , Object > iProperties ) { } @ Override public boolean exists ( ) { } @ Override public void reload ( ) { } @ Override public void delete ( ) { } @ Override public void close ( ) { } @ Override public void close ( final boolean iForce , boolean onDelete ) { } @ Override public boolean isClosed ( ) { } @ Override public void commit ( final OTransaction iTx , final Runnable callback ) { if ( ( INSTANCE . get ( ) ) == ( RUN_MODE . RUNNING_DISTRIBUTED ) ) { wrapped . commit ( iTx , callback ) ; return ; } try { final ODistributedConfiguration dbCfg = dManager . getDatabaseConfiguration ( getName ( ) ) ; if ( ! ( dbCfg . isReplicationActive ( null , dManager . getLocalNodeName ( ) ) ) ) { ODistributedAbstractPlugin . runInDistributedMode ( new Callable ( ) { @ Override public Object call ( ) throws Exception { wrapped . commit ( iTx , callback ) ; return null ; } } ) ; return ; } final OTxTask txTask = new OTxTask ( ) ; final Set < String > involvedClusters = new HashSet < String > ( ) ; for ( ORecordOperation op : iTx . getCurrentRecordEntries ( ) ) { final OAbstractRecordReplicatedTask task ; final ORecord record = op . getRecord ( ) ; final ORecordId rid = ( ( ORecordId ) ( op . record . getIdentity ( ) ) ) ; switch ( op . type ) { case ORecordOperation . CREATED : final byte [ ] stream = record . toStream ( ) ; <START_BUG> if ( ! ( rid . isPersistent ( ) ) ) { <END_BUG> task = new OCreateRecordTask ( rid , stream , record . getRecordVersion ( ) , ORecordInternal . getRecordType ( record ) ) ; break ; } case ORecordOperation . UPDATED : final OStorageOperationResult < ORawBuffer > previousContent = wrapped . readRecord ( rid , null , false , null , false , DEFAULT ) ; if ( ( previousContent . getResult ( ) ) == null ) throw new OTransactionException ( ( ( "Cannot<seq2seq4repair_space>update<seq2seq4repair_space>record<seq2seq4repair_space>'" + rid ) + "'<seq2seq4repair_space>because<seq2seq4repair_space>has<seq2seq4repair_space>been<seq2seq4repair_space>deleted" ) ) ; task = new OUpdateRecordTask ( rid , previousContent . getResult ( ) . getBuffer ( ) , previousContent . getResult ( ) . version , record . toStream ( ) , record . getRecordVersion ( ) ) ; break ; case ORecordOperation . DELETED : task = new ODeleteRecordTask ( rid , record . getRecordVersion ( ) ) ; break ; default : continue ; } involvedClusters . add ( getClusterNameByRID ( rid ) ) ; txTask . add ( task ) ; } final Set < String > nodes = dbCfg . getServers ( involvedClusters ) ; Boolean executionModeSynch = dbCfg . isExecutionModeSynchronous ( null ) ; if ( executionModeSynch == null ) executionModeSynch = Boolean . TRUE ; if ( executionModeSynch ) { final Object result = dManager . sendRequest ( getName ( ) , involvedClusters , nodes , txTask , RESPONSE ) ; if ( result instanceof List < ? > ) { final List < Object > list = ( ( List < Object > ) ( result ) ) ; for ( int i = 0 ; i < ( txTask . getTasks ( ) . size ( ) ) ; ++ i ) { final Object o = list . get ( i ) ; final OAbstractRecordReplicatedTask task = txTask . getTasks ( ) . get ( i ) ;

Fix:
if ( rid . isNew ( ) ) {