diff options
author | Justin Seyster <justin.seyster@mongodb.com> | 2023-01-31 16:55:05 -0500 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2023-02-01 07:32:04 +0000 |
commit | 923f10421df339783d3f1baeb60be5bac3180fa3 (patch) | |
tree | 8aa5a8c6173d442c7d268ab4b79beee5537e08cc /src/mongo/db/index | |
parent | 810bc652885578ab293680db7f475ebaf947599f (diff) | |
download | mongo-923f10421df339783d3f1baeb60be5bac3180fa3.tar.gz |
SERVER-73465 Updates during column store index build can result in no-op side writes
Diffstat (limited to 'src/mongo/db/index')
-rw-r--r-- | src/mongo/db/index/columns_access_method.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/mongo/db/index/columns_access_method.cpp b/src/mongo/db/index/columns_access_method.cpp index f894117fb97..9300f8fbc4d 100644 --- a/src/mongo/db/index/columns_access_method.cpp +++ b/src/mongo/db/index/columns_access_method.cpp @@ -398,10 +398,16 @@ Status ColumnStoreAccessMethod::update(OperationContext* opCtx, diffAction); }); + // Create a "side write" that records the changes made to this document during the bulk + // build, so that they can be applied when the bulk builder finishes. It is possible that an + // update does not result in any changes when there is a "columnstoreProjection" on the + // index that excludes all the changed fields. int64_t inserted = 0; int64_t deleted = 0; - Status status = _indexCatalogEntry->indexBuildInterceptor()->sideWrite( - opCtx, *columnChanges, &inserted, &deleted); + if (columnChanges->size() > 0) { + uassertStatusOK(_indexCatalogEntry->indexBuildInterceptor()->sideWrite( + opCtx, *columnChanges, &inserted, &deleted)); + } if (keysInsertedOut) { *keysInsertedOut += inserted; } |