Fix review comments: release notes and formatting

This commit is contained in:
Jingyu Zhou 2019-07-18 10:26:39 -07:00
parent 4b36099097
commit 7c0aca5b0c
2 changed files with 10 additions and 9 deletions

View File

@ -26,7 +26,7 @@ Status
Bindings
--------
* C: Added ``fdb_transaction_get_approximate_size`` to get the approximated transaction size before commit. `(PR #1756) <https://github.com/apple/foundationdb/pull/1756>`_.
* Added a new API to get the approximated transaction size before commit, e.g., ``fdb_transaction_get_approximate_size`` in the C binding. `(PR #1756) <https://github.com/apple/foundationdb/pull/1756>`_.
* C: ``fdb_future_get_version`` has been renamed to ``fdb_future_get_int64``. `(PR #1756) <https://github.com/apple/foundationdb/pull/1756>`_.
* Go: The Go bindings now require Go version 1.11 or later.
* Go: Fix issue with finalizers running too early that could lead to undefined behavior. `(PR #1451) <https://github.com/apple/foundationdb/pull/1451>`_.

View File

@ -1448,10 +1448,10 @@ void ReadYourWritesTransaction::writeRangeToNativeTransaction(KeyRangeRef const&
switch(op[i].type) {
case MutationRef::SetValue:
if (op[i].value.present()) {
tr.set(it.beginKey().assertRef(), op[i].value.get(), false);
} else {
tr.clear(it.beginKey().assertRef(), false);
}
tr.set(it.beginKey().assertRef(), op[i].value.get(), false);
} else {
tr.clear(it.beginKey().assertRef(), false);
}
break;
case MutationRef::AddValue:
case MutationRef::AppendIfFits:
@ -1467,8 +1467,8 @@ void ReadYourWritesTransaction::writeRangeToNativeTransaction(KeyRangeRef const&
case MutationRef::MinV2:
case MutationRef::AndV2:
case MutationRef::CompareAndClear:
tr.atomicOp(it.beginKey().assertRef(), op[i].value.get(), op[i].type, false);
break;
tr.atomicOp(it.beginKey().assertRef(), op[i].value.get(), op[i].type, false);
break;
default:
break;
}
@ -1582,8 +1582,9 @@ void ReadYourWritesTransaction::atomicOp( const KeyRef& key, const ValueRef& ope
throw client_invalid_operation();
}
approximateSize += k.expectedSize() + v.expectedSize() + sizeof(MutationRef);
if(options.readYourWritesDisabled) {
approximateSize += k.expectedSize() + v.expectedSize() + sizeof(MutationRef) +
(addWriteConflict ? sizeof(KeyRangeRef) + 2 * key.expectedSize() + 1 : 0);
if (options.readYourWritesDisabled) {
return tr.atomicOp(k, v, (MutationRef::Type) operationType, addWriteConflict);
}