Skip to content

Commit 810b253

Browse files
committed
SERVER-34364 replace references to invariantOK with invariant
1 parent 316bcc9 commit 810b253

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+85
-85
lines changed

src/mongo/db/auth/action_set.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ Status ActionSet::parseActionSetFromString(const std::string& actionsString, Act
9797
splitStringDelim(actionsString, &actionsList, ',');
9898
std::vector<std::string> unrecognizedActions;
9999
Status status = parseActionSetFromStringVector(actionsList, result, &unrecognizedActions);
100-
invariantOK(status);
100+
invariant(status);
101101
if (unrecognizedActions.empty()) {
102102
return Status::OK();
103103
}
@@ -118,7 +118,7 @@ Status ActionSet::parseActionSetFromStringVector(const std::vector<std::string>&
118118
if (status == ErrorCodes::FailedToParse) {
119119
unrecognizedActions->push_back(actionsVector[i]);
120120
} else {
121-
invariantOK(status);
121+
invariant(status);
122122
if (action == ActionType::anyAction) {
123123
result->addAllActions();
124124
return Status::OK();

src/mongo/db/catalog/coll_mod.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -410,11 +410,11 @@ Status _collModInternal(OperationContext* opCtx,
410410

411411
// The Validator, ValidationAction and ValidationLevel are already parsed and must be OK.
412412
if (!cmr.collValidator.eoo())
413-
invariantOK(coll->setValidator(opCtx, cmr.collValidator.Obj()));
413+
invariant(coll->setValidator(opCtx, cmr.collValidator.Obj()));
414414
if (!cmr.collValidationAction.empty())
415-
invariantOK(coll->setValidationAction(opCtx, cmr.collValidationAction));
415+
invariant(coll->setValidationAction(opCtx, cmr.collValidationAction));
416416
if (!cmr.collValidationLevel.empty())
417-
invariantOK(coll->setValidationLevel(opCtx, cmr.collValidationLevel));
417+
invariant(coll->setValidationLevel(opCtx, cmr.collValidationLevel));
418418

419419
// UsePowerof2Sizes
420420
if (!cmr.usePowerOf2Sizes.eoo())

src/mongo/db/catalog/collection_impl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ std::unique_ptr<CollatorInterface> parseCollation(OperationContext* opCtx,
129129
<< collationSpec;
130130
fassertFailedNoTrace(40144);
131131
}
132-
invariantOK(collator.getStatus());
132+
invariant(collator.getStatus());
133133

134134
return std::move(collator.getValue());
135135
}

src/mongo/db/catalog/index_catalog_entry_impl.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ IndexCatalogEntryImpl::IndexCatalogEntryImpl(IndexCatalogEntry* const this_,
120120
CollatorFactoryInterface::get(opCtx->getServiceContext())->makeFromBSON(collation);
121121

122122
// Index spec should have already been validated.
123-
invariantOK(statusWithCollator.getStatus());
123+
invariant(statusWithCollator.getStatus());
124124

125125
_collator = std::move(statusWithCollator.getValue());
126126
}
@@ -138,7 +138,7 @@ IndexCatalogEntryImpl::IndexCatalogEntryImpl(IndexCatalogEntry* const this_,
138138
std::move(expCtx),
139139
ExtensionsCallbackNoop(),
140140
MatchExpressionParser::kBanAllSpecialFeatures);
141-
invariantOK(statusWithMatcher.getStatus());
141+
invariant(statusWithMatcher.getStatus());
142142
_filterExpression = std::move(statusWithMatcher.getValue());
143143
LOG(2) << "have filter expression for " << _ns << " " << _descriptor->indexName() << " "
144144
<< redact(filter);

src/mongo/db/commands/create_indexes.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ StatusWith<std::vector<BSONObj>> resolveCollectionDefaultProperties(
182182
->makeFromBSON(collationElem.Obj());
183183
// validateIndexSpecCollation() should have checked that the index collation spec is
184184
// valid.
185-
invariantOK(collatorStatus.getStatus());
185+
invariant(collatorStatus.getStatus());
186186
indexCollator = std::move(collatorStatus.getValue());
187187
}
188188
if (!CollatorInterface::collatorsMatch(collection->getDefaultCollator(),

src/mongo/db/commands/index_filter_commands.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ Status ClearFilters::clear(OperationContext* opCtx,
313313
expCtx,
314314
extensionsCallback,
315315
MatchExpressionParser::kAllowAllSpecialFeatures);
316-
invariantOK(statusWithCQ.getStatus());
316+
invariant(statusWithCQ.getStatus());
317317
std::unique_ptr<CanonicalQuery> cq = std::move(statusWithCQ.getValue());
318318

319319
// Remove plan cache entry.

src/mongo/db/matcher/expression_text_noop.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ TextNoOpMatchExpression::TextNoOpMatchExpression(TextParams params)
4040
_ftsQuery.setLanguage(std::move(params.language));
4141
_ftsQuery.setCaseSensitive(params.caseSensitive);
4242
_ftsQuery.setDiacriticSensitive(params.diacriticSensitive);
43-
invariantOK(_ftsQuery.parse(fts::TEXT_INDEX_VERSION_INVALID));
43+
invariant(_ftsQuery.parse(fts::TEXT_INDEX_VERSION_INVALID));
4444
}
4545

4646
std::unique_ptr<MatchExpression> TextNoOpMatchExpression::shallowClone() const {

src/mongo/db/matcher/expression_with_placeholder.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ void ExpressionWithPlaceholder::optimizeFilter() {
118118
_filter = MatchExpression::optimize(std::move(_filter));
119119

120120
auto newPlaceholder = parseTopLevelFieldName(_filter.get());
121-
invariantOK(newPlaceholder.getStatus());
121+
invariant(newPlaceholder.getStatus());
122122

123123
if (newPlaceholder.getValue()) {
124124
_placeholder = newPlaceholder.getValue()->toString();

src/mongo/db/matcher/extensions_callback.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ ExtensionsCallback::extractTextMatchExpressionParams(BSONElement text) {
6363
} else if (languageStatus == ErrorCodes::NoSuchKey) {
6464
params.language = std::string();
6565
} else {
66-
invariantOK(languageStatus);
66+
invariant(languageStatus);
6767
expectedFieldCount++;
6868
}
6969

@@ -74,7 +74,7 @@ ExtensionsCallback::extractTextMatchExpressionParams(BSONElement text) {
7474
} else if (caseSensitiveStatus == ErrorCodes::NoSuchKey) {
7575
params.caseSensitive = TextMatchExpressionBase::kCaseSensitiveDefault;
7676
} else {
77-
invariantOK(caseSensitiveStatus);
77+
invariant(caseSensitiveStatus);
7878
expectedFieldCount++;
7979
}
8080

@@ -85,7 +85,7 @@ ExtensionsCallback::extractTextMatchExpressionParams(BSONElement text) {
8585
} else if (diacriticSensitiveStatus == ErrorCodes::NoSuchKey) {
8686
params.diacriticSensitive = TextMatchExpressionBase::kDiacriticSensitiveDefault;
8787
} else {
88-
invariantOK(diacriticSensitiveStatus);
88+
invariant(diacriticSensitiveStatus);
8989
expectedFieldCount++;
9090
}
9191

src/mongo/db/query/internal_plans.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ std::unique_ptr<PlanExecutor, PlanExecutor::Deleter> InternalPlanner::deleteWith
8888

8989
auto executor =
9090
PlanExecutor::make(opCtx, std::move(ws), std::move(root), collection, yieldPolicy);
91-
invariantOK(executor.getStatus());
91+
invariant(executor.getStatus());
9292
return std::move(executor.getValue());
9393
}
9494

@@ -117,7 +117,7 @@ std::unique_ptr<PlanExecutor, PlanExecutor::Deleter> InternalPlanner::indexScan(
117117

118118
auto executor =
119119
PlanExecutor::make(opCtx, std::move(ws), std::move(root), collection, yieldPolicy);
120-
invariantOK(executor.getStatus());
120+
invariant(executor.getStatus());
121121
return std::move(executor.getValue());
122122
}
123123

@@ -147,7 +147,7 @@ std::unique_ptr<PlanExecutor, PlanExecutor::Deleter> InternalPlanner::deleteWith
147147

148148
auto executor =
149149
PlanExecutor::make(opCtx, std::move(ws), std::move(root), collection, yieldPolicy);
150-
invariantOK(executor.getStatus());
150+
invariant(executor.getStatus());
151151
return std::move(executor.getValue());
152152
}
153153

@@ -166,7 +166,7 @@ std::unique_ptr<PlanExecutor, PlanExecutor::Deleter> InternalPlanner::updateWith
166166

167167
auto executor =
168168
PlanExecutor::make(opCtx, std::move(ws), std::move(root), collection, yieldPolicy);
169-
invariantOK(executor.getStatus());
169+
invariant(executor.getStatus());
170170
return std::move(executor.getValue());
171171
}
172172

0 commit comments

Comments
 (0)