@@ -1552,7 +1552,7 @@ ACTOR static Future<Void> updateIndexStatus(PlanCheckpoint* checkpoint,
15521552 Standalone<StringRef> encodedIndexId,
15531553 Reference<MetadataManager> mm,
15541554 std::string newStatus,
1555- Optional< UID> buildId,
1555+ UID buildId,
15561556 PromiseStream<Reference<ScanReturnedContext>> output) {
15571557 state bool okay;
15581558 state FlowLock* flowControlLock = checkpoint->getDocumentFinishedLock ();
@@ -1563,21 +1563,23 @@ ACTOR static Future<Void> updateIndexStatus(PlanCheckpoint* checkpoint,
15631563 indexCollection->bindCollectionContext (tr)->cx ->getSubContext (encodedIndexId);
15641564 Reference<UnboundCollectionContext> ucx = wait (mm->getUnboundCollectionContext (tr, ns));
15651565 state Reference<CollectionContext> mcx = ucx->bindCollectionContext (tr);
1566- if (buildId.present ()) {
1567- Optional<DataValue> dv =
1568- wait (indexDoc->get (DataValue (DocLayerConstants::BUILD_ID_FIELD, DVTypeCode::STRING).encode_key_part ()));
1569- if (dv.present ()) {
1570- UID currId = UID::fromString (dv.get ().getString ());
1571- if (currId == buildId.get ()) {
1572- okay = true ;
1573- } else {
1574- okay = false ;
1575- }
1566+ Optional<DataValue> dv =
1567+ wait (indexDoc->get (DataValue (DocLayerConstants::BUILD_ID_FIELD, DVTypeCode::STRING).encode_key_part ()));
1568+ if (dv.present ()) {
1569+ UID currId = UID::fromString (dv.get ().getString ());
1570+ if (currId == buildId) {
1571+ okay = true ;
15761572 } else {
1573+ TraceEvent (SevError, " MismatchedIndexBuildID" )
1574+ .detail (" indexDoc" , indexDoc->toDbgString ())
1575+ .detail (" newStatus" , newStatus);
15771576 okay = false ;
15781577 }
15791578 } else {
1580- okay = true ;
1579+ TraceEvent (SevError, " MissingIndexBuildID" )
1580+ .detail (" indexDoc" , indexDoc->toDbgString ())
1581+ .detail (" newStatus" , newStatus);
1582+ okay = false ;
15811583 }
15821584
15831585 if (okay) {
0 commit comments