SERVER-115461 Report bucket validation error reasons for 6698300 failures (#45260)

GitOrigin-RevId: 0d7df0bf1c240aef7988b663caf89ee1d36a1954
This commit is contained in:
Binh Vo 2025-12-16 11:48:49 -05:00 committed by MongoDB Bot
parent b006f9bfed
commit dc1f11645d
2 changed files with 2 additions and 5 deletions

View File

@ -145,7 +145,7 @@ getTimeseriesCollForRawOps(db, coll).updateOne(
res = coll.validate();
assert(!res.valid, tojson(res));
assert.eq(res.nNonCompliantDocuments, 2);
assert.eq(res.errors.length, 1);
assert.eq(res.errors.length, 2);
// As of SERVER-86451, time-series inconsistencies detected during validation
// will error in testing, instead of being warnings. In this case,

View File

@ -110,9 +110,6 @@ const long long kInterruptIntervalNumBytes = 50 * 1024 * 1024; // 50MB.
static constexpr const char* kSchemaValidationFailedReason =
"Detected one or more documents not compliant with the collection's schema. Check logs for log "
"id 5363500.";
static constexpr const char* kTimeseriesValidationInconsistencyReason =
"Detected one or more documents in this collection incompatible with time-series "
"specifications. For more info, see logs with log id 6698300.";
static constexpr const char* kBSONValidationNonConformantReason =
"Detected one or more documents in this collection not conformant to BSON specifications. For "
"more info, see logs with log id 6825900";
@ -1137,7 +1134,7 @@ void ValidateAdaptor::traverseRecordStore(OperationContext* opCtx,
"recordId"_attr = record->id,
"reason"_attr = bucketStatus);
nNonCompliantDocuments++;
results->addError(kTimeseriesValidationInconsistencyReason);
results->addError(bucketStatus.reason());
}
auto containsMixedSchemaDataResponse =
coll->doesTimeseriesBucketsDocContainMixedSchemaData(recordBson);