diff --git a/fdbclient/MasterProxyInterface.h b/fdbclient/MasterProxyInterface.h index 81fb717b87..ae9a1db049 100644 --- a/fdbclient/MasterProxyInterface.h +++ b/fdbclient/MasterProxyInterface.h @@ -104,7 +104,7 @@ struct CommitID { Version version; // returns invalidVersion if transaction conflicts uint16_t txnBatchId; Optional metadataVersion; - Optional>> conflictingKeyRanges; + Optional> conflictingKeyRanges; template void serialize(Ar& ar) { @@ -112,7 +112,7 @@ struct CommitID { } CommitID() : version(invalidVersion), txnBatchId(0) {} - CommitID( Version version, uint16_t txnBatchId, const Optional& metadataVersion, const Optional>>& conflictingKeyRanges = Optional>>() ) : version(version), txnBatchId(txnBatchId), metadataVersion(metadataVersion), conflictingKeyRanges(conflictingKeyRanges) {} + CommitID( Version version, uint16_t txnBatchId, const Optional& metadataVersion, const Optional>& conflictingKeyRanges = Optional>() ) : version(version), txnBatchId(txnBatchId), metadataVersion(metadataVersion), conflictingKeyRanges(conflictingKeyRanges) {} }; struct CommitTransactionRequest : TimedRequest { diff --git a/fdbclient/NativeAPI.actor.cpp b/fdbclient/NativeAPI.actor.cpp index c95ad1bd3a..d02ff9cd48 100644 --- a/fdbclient/NativeAPI.actor.cpp +++ b/fdbclient/NativeAPI.actor.cpp @@ -2691,6 +2691,7 @@ ACTOR static Future tryCommit( Database cx, Reference // in case system keys are conflicting tr->info.conflictingKeysRYW->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); tr->info.conflictingKeysRYW->clear(systemKeys); + // merge duplicate indices const auto cKRs = ci.conflictingKeyRanges.get(); std::set mergedIds(cKRs.begin(), cKRs.end()); for (auto const & rCRIndex : mergedIds) { diff --git a/fdbserver/MasterProxyServer.actor.cpp b/fdbserver/MasterProxyServer.actor.cpp index 22e5ee7913..3a4fe6a20b 100644 --- a/fdbserver/MasterProxyServer.actor.cpp +++ b/fdbserver/MasterProxyServer.actor.cpp @@ -1034,15 +1034,15 @@ ACTOR Future commitBatch( else { // If enable the option to report conflicting keys from resolvers, we union all conflicting key ranges here and send back through CommitID if (trs[t].transaction.report_conflicting_keys) { - Standalone> conflictingEntryIds; + std::vector conflictingEntryIds; for (int resolverInd : transactionResolverMap[t]) { for (auto const & rCRIndex : resolution[resolverInd].conflictingKeyRangeMap[nextTr[resolverInd]]){ - conflictingEntryIds.push_back(conflictingEntryIds.arena(), rCRIndex); + conflictingEntryIds.emplace_back(rCRIndex); } } // At least one keyRange index should be returned ASSERT(conflictingEntryIds.size()); - trs[t].reply.send(CommitID(invalidVersion, t, Optional(), Optional>>(conflictingEntryIds))); + trs[t].reply.send(CommitID(invalidVersion, t, Optional(), Optional>(conflictingEntryIds))); } else { trs[t].reply.sendError(not_committed()); }