@ -232,7 +232,7 @@ Status WriteCommittedTxn::PrepareInternal() {
WriteBatchInternal : : MarkEndPrepare ( GetWriteBatch ( ) - > GetWriteBatch ( ) , name_ ) ;
WriteBatchInternal : : MarkEndPrepare ( GetWriteBatch ( ) - > GetWriteBatch ( ) , name_ ) ;
Status s =
Status s =
db_impl_ - > WriteImpl ( write_options , GetWriteBatch ( ) - > GetWriteBatch ( ) ,
db_impl_ - > WriteImpl ( write_options , GetWriteBatch ( ) - > GetWriteBatch ( ) ,
/*callback*/ nullptr , & log_number_ , /*log ref*/ 0 ,
/*callback*/ nullptr , & log_number_ , /*log_ ref*/ 0 ,
/* disable_memtable*/ true ) ;
/* disable_memtable*/ true ) ;
return s ;
return s ;
}
}
@ -322,12 +322,27 @@ Status PessimisticTransaction::Commit() {
}
}
Status WriteCommittedTxn : : CommitWithoutPrepareInternal ( ) {
Status WriteCommittedTxn : : CommitWithoutPrepareInternal ( ) {
Status s = db_ - > Write ( write_options_ , GetWriteBatch ( ) - > GetWriteBatch ( ) ) ;
uint64_t seq_used = kMaxSequenceNumber ;
auto s =
db_impl_ - > WriteImpl ( write_options_ , GetWriteBatch ( ) - > GetWriteBatch ( ) ,
/*callback*/ nullptr , /*log_used*/ nullptr ,
/*log_ref*/ 0 , /*disable_memtable*/ false , & seq_used ) ;
assert ( ! s . ok ( ) | | seq_used ! = kMaxSequenceNumber ) ;
if ( s . ok ( ) ) {
SetId ( seq_used ) ;
}
return s ;
return s ;
}
}
Status WriteCommittedTxn : : CommitBatchInternal ( WriteBatch * batch , size_t ) {
Status WriteCommittedTxn : : CommitBatchInternal ( WriteBatch * batch , size_t ) {
Status s = db_ - > Write ( write_options_ , batch ) ;
uint64_t seq_used = kMaxSequenceNumber ;
auto s = db_impl_ - > WriteImpl ( write_options_ , batch , /*callback*/ nullptr ,
/*log_used*/ nullptr , /*log_ref*/ 0 ,
/*disable_memtable*/ false , & seq_used ) ;
assert ( ! s . ok ( ) | | seq_used ! = kMaxSequenceNumber ) ;
if ( s . ok ( ) ) {
SetId ( seq_used ) ;
}
return s ;
return s ;
}
}
@ -345,8 +360,15 @@ Status WriteCommittedTxn::CommitInternal() {
// in non recovery mode and simply insert the values
// in non recovery mode and simply insert the values
WriteBatchInternal : : Append ( working_batch , GetWriteBatch ( ) - > GetWriteBatch ( ) ) ;
WriteBatchInternal : : Append ( working_batch , GetWriteBatch ( ) - > GetWriteBatch ( ) ) ;
auto s = db_impl_ - > WriteImpl ( write_options_ , working_batch , nullptr , nullptr ,
uint64_t seq_used = kMaxSequenceNumber ;
log_number_ ) ;
auto s =
db_impl_ - > WriteImpl ( write_options_ , working_batch , /*callback*/ nullptr ,
/*log_used*/ nullptr , /*log_ref*/ log_number_ ,
/*disable_memtable*/ false , & seq_used ) ;
assert ( ! s . ok ( ) | | seq_used ! = kMaxSequenceNumber ) ;
if ( s . ok ( ) ) {
SetId ( seq_used ) ;
}
return s ;
return s ;
}
}