summaryrefslogtreecommitdiff
path: root/src/mongo/db/catalog/validate_state.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/catalog/validate_state.h')
-rw-r--r--src/mongo/db/catalog/validate_state.h38
1 files changed, 11 insertions, 27 deletions
diff --git a/src/mongo/db/catalog/validate_state.h b/src/mongo/db/catalog/validate_state.h
index bb8f431d2d6..df796c686ce 100644
--- a/src/mongo/db/catalog/validate_state.h
+++ b/src/mongo/db/catalog/validate_state.h
@@ -55,12 +55,15 @@ class ValidateState {
ValidateState& operator=(const ValidateState&) = delete;
public:
+ /**
+ * 'turnOnExtraLoggingForTest' turns on extra logging for test debugging. This parameter is for
+ * unit testing only.
+ */
ValidateState(OperationContext* opCtx,
const NamespaceString& nss,
ValidateMode mode,
RepairMode repairMode,
- const AdditionalOptions& additionalOptions,
- bool logDiagnostics);
+ bool turnOnExtraLoggingForTest = false);
const NamespaceString& nss() const {
return _nss;
@@ -93,13 +96,6 @@ public:
_collectionSchemaViolated = true;
}
- bool isTimeseriesDataInconsistent() {
- return _timeseriesDataInconsistency;
- }
- void setTimeseriesDataInconsistent() {
- _timeseriesDataInconsistency = true;
- }
-
bool fixErrors() const {
return _repairMode == RepairMode::kFixErrors;
}
@@ -127,10 +123,6 @@ public:
return _indexes;
}
- const StringSet& getSkippedIndexes() const {
- return _skippedIndexes;
- }
-
/**
* Map of index names to index cursors.
*/
@@ -170,13 +162,11 @@ public:
/**
* Indicates whether extra logging should occur during validation.
+ *
+ * This is for unit testing only. Intended to improve diagnosibility.
*/
- bool logDiagnostics() {
- return _logDiagnostics;
- }
-
- ValidationVersion validationVersion() const {
- return _validationVersion;
+ bool extraLoggingForTest() {
+ return _extraLoggingForTest;
}
boost::optional<Timestamp> getValidateTimestamp() {
@@ -221,8 +211,6 @@ private:
ValidateMode _mode;
RepairMode _repairMode;
bool _collectionSchemaViolated = false;
- bool _timeseriesDataInconsistency = false;
- ValidationVersion _validationVersion = currentValidationVersion;
boost::optional<ShouldNotConflictWithSecondaryBatchApplicationBlock> _noPBWM;
boost::optional<Lock::GlobalLock> _globalLock;
@@ -247,10 +235,6 @@ private:
std::unique_ptr<SeekableRecordThrottleCursor> _traverseRecordStoreCursor;
std::unique_ptr<SeekableRecordThrottleCursor> _seekRecordStoreCursor;
- // Stores the set of indexes that will not be validated for some reason, e.g. they are not
- // ready.
- StringSet _skippedIndexes;
-
RecordId _firstRecordId;
DataThrottle _dataThrottle;
@@ -258,8 +242,8 @@ private:
// Used to detect when the catalog is re-opened while yielding locks.
uint64_t _catalogGeneration;
- // Can be set to obtain better insight into what validate sees/does.
- bool _logDiagnostics;
+ // Can be set by unit tests to obtain better insight into what validate sees/does.
+ bool _extraLoggingForTest;
boost::optional<Timestamp> _validateTs = boost::none;
};