summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenrik Edin <henrik.edin@mongodb.com>2021-07-28 15:54:00 -0400
committerHenrik Edin <henrik.edin@mongodb.com>2021-07-28 15:54:00 -0400
commit83b8bb8b6b325d8d8d3dfd2ad9f744bdad7d6ca0 (patch)
tree68d285a5e3a2f0f017a9e2663e09b5878e1505fd
parente21a59d53ffb6ebd0fe3194057d4850ff7f6c3f3 (diff)
downloadmongo-r4.4.8.tar.gz
Revert "SERVER-56509 Wrap unique index insertion _keyExists call in a WT cursor reconfigure"r4.4.8-rc0r4.4.8
This reverts commit ae2da27652e552f101559466d165b82a3c122d71.
-rw-r--r--src/mongo/db/storage/wiredtiger/wiredtiger_index.cpp7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_index.cpp b/src/mongo/db/storage/wiredtiger/wiredtiger_index.cpp
index 5e704c8fe46..f39007f4970 100644
--- a/src/mongo/db/storage/wiredtiger/wiredtiger_index.cpp
+++ b/src/mongo/db/storage/wiredtiger/wiredtiger_index.cpp
@@ -1640,12 +1640,7 @@ Status WiredTigerIndexUnique::_insertTimestampSafe(OperationContext* opCtx,
invariantWTOK(ret);
// Second phase looks up for existence of key to avoid insertion of duplicate key
- // The usage of 'prefix_key=true' enables an optimization that allows this search to return
- // more quickly. See SERVER-56509.
- c->reconfigure(c, "prefix_key=true");
- ON_BLOCK_EXIT([c] { c->reconfigure(c, "prefix_key=false"); });
- auto keyExists = _keyExists(opCtx, c, keyString.getBuffer(), sizeWithoutRecordId);
- if (keyExists) {
+ if (_keyExists(opCtx, c, keyString.getBuffer(), sizeWithoutRecordId)) {
auto key = KeyString::toBson(
keyString.getBuffer(), sizeWithoutRecordId, _ordering, keyString.getTypeBits());
return buildDupKeyErrorStatus(