summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRamon Fernandez <ramon@mongodb.com>2016-08-24 15:26:18 -0400
committerRamon Fernandez <ramon@mongodb.com>2016-08-25 17:59:42 -0400
commitc2637115ce7dd52220a1ebcf6557c938969e06d7 (patch)
treebe393499e69c72c6ff6bb8fc214deff31ace06d0
parent6db3c739f65bcd5ee591930d7c7aa8ad6f47e1fd (diff)
downloadmongo-c2637115ce7dd52220a1ebcf6557c938969e06d7.tar.gz
SERVER-24991 log redaction for storage layer and mmapv1
-rw-r--r--etc/log_redaction.audit106
-rw-r--r--src/mongo/db/storage/mmap_v1/btree/btree_logic.cpp8
-rw-r--r--src/mongo/db/storage/mmap_v1/dur.cpp23
-rw-r--r--src/mongo/db/storage/mmap_v1/dur_journal.cpp2
-rw-r--r--src/mongo/db/storage/mmap_v1/dur_journal_writer.cpp6
-rw-r--r--src/mongo/db/storage/mmap_v1/dur_recover.cpp4
-rw-r--r--src/mongo/db/storage/mmap_v1/dur_recovery_unit.cpp2
-rw-r--r--src/mongo/db/storage/mmap_v1/durable_mapped_file.cpp2
-rw-r--r--src/mongo/db/storage/mmap_v1/record_store_v1_base.cpp2
-rw-r--r--src/mongo/db/storage/mmap_v1/repair_database.cpp2
-rw-r--r--src/mongo/db/storage/wiredtiger/wiredtiger_index.cpp10
-rw-r--r--src/mongo/db/storage/wiredtiger/wiredtiger_recovery_unit.cpp2
-rw-r--r--src/mongo/db/storage/wiredtiger/wiredtiger_size_storer.cpp4
-rw-r--r--src/mongo/db/storage/wiredtiger/wiredtiger_util.cpp6
14 files changed, 91 insertions, 88 deletions
diff --git a/etc/log_redaction.audit b/etc/log_redaction.audit
index fe1cc8f1bd3..ce6f0ba0301 100644
--- a/etc/log_redaction.audit
+++ b/etc/log_redaction.audit
@@ -237,59 +237,59 @@
:ramon:src/mongo/db/startup_warnings_mongod.cpp:56
:ramon:src/mongo/db/stats/counters.cpp:1
:ramon:src/mongo/db/stats/snapshots.cpp:1
-:ramon:src/mongo/db/storage/kv/kv_catalog.cpp:7
-:ramon:src/mongo/db/storage/kv/kv_catalog.h:1
-:ramon:src/mongo/db/storage/kv/kv_database_catalog_entry.cpp:17
-:ramon:src/mongo/db/storage/kv/kv_database_catalog_entry_get_index.cpp:2
-:ramon:src/mongo/db/storage/kv/kv_storage_engine.cpp:2
-:ramon:src/mongo/db/storage/kv/kv_storage_engine.h:2
-:ramon:src/mongo/db/storage/mmap_v1/aligned_builder.cpp:3
-:ramon:src/mongo/db/storage/mmap_v1/btree/btree_logic.cpp:27
-:ramon:src/mongo/db/storage/mmap_v1/btree/btree_ondisk.cpp:1
-:ramon:src/mongo/db/storage/mmap_v1/btree/key.cpp:1
-:ramon:src/mongo/db/storage/mmap_v1/catalog/hashtab.cpp:3
-:ramon:src/mongo/db/storage/mmap_v1/catalog/namespace_details_collection_entry.cpp:1
-:ramon:src/mongo/db/storage/mmap_v1/catalog/namespace_index.cpp:4
-:ramon:src/mongo/db/storage/mmap_v1/data_file.cpp:3
-:ramon:src/mongo/db/storage/mmap_v1/data_file_sync.cpp:4
-:ramon:src/mongo/db/storage/mmap_v1/dur.cpp:32
-:ramon:src/mongo/db/storage/mmap_v1/dur_commitjob.cpp:1
-:ramon:src/mongo/db/storage/mmap_v1/dur_journal.cpp:41
-:ramon:src/mongo/db/storage/mmap_v1/dur_journal_writer.cpp:10
-:ramon:src/mongo/db/storage/mmap_v1/dur_preplogbuffer.cpp:2
-:ramon:src/mongo/db/storage/mmap_v1/dur_recover.cpp:31
-:ramon:src/mongo/db/storage/mmap_v1/dur_recovery_unit.cpp:7
-:ramon:src/mongo/db/storage/mmap_v1/durable_mapped_file.cpp:8
-:ramon:src/mongo/db/storage/mmap_v1/durop.cpp:4
-:ramon:src/mongo/db/storage/mmap_v1/file_allocator.cpp:13
-:ramon:src/mongo/db/storage/mmap_v1/logfile.cpp:4
-:ramon:src/mongo/db/storage/mmap_v1/mmap.cpp:3
-:ramon:src/mongo/db/storage/mmap_v1/mmap_posix.cpp:14
-:ramon:src/mongo/db/storage/mmap_v1/mmap_v1_database_catalog_entry.cpp:6
-:ramon:src/mongo/db/storage/mmap_v1/mmap_v1_engine.cpp:20
-:ramon:src/mongo/db/storage/mmap_v1/mmap_v1_extent_manager.cpp:9
-:ramon:src/mongo/db/storage/mmap_v1/mmap_windows.cpp:11
-:ramon:src/mongo/db/storage/mmap_v1/record_store_v1_base.cpp:1
-:ramon:src/mongo/db/storage/mmap_v1/record_store_v1_capped.cpp:2
-:ramon:src/mongo/db/storage/mmap_v1/record_store_v1_repair_iterator.cpp:5
-:ramon:src/mongo/db/storage/mmap_v1/record_store_v1_simple.cpp:11
-:ramon:src/mongo/db/storage/mmap_v1/repair_database.cpp:7
-:ramon:src/mongo/db/storage/paths.cpp:6
-:ramon:src/mongo/db/storage/storage_engine_lock_file_posix.cpp:2
-:ramon:src/mongo/db/storage/storage_engine_lock_file_windows.cpp:2
-:ramon:src/mongo/db/storage/storage_engine_metadata.cpp:1
-:ramon:src/mongo/db/storage/wiredtiger/wiredtiger_global_options.cpp:3
-:ramon:src/mongo/db/storage/wiredtiger/wiredtiger_index.cpp:14
-:ramon:src/mongo/db/storage/wiredtiger/wiredtiger_init.cpp:1
-:ramon:src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp:19
-:ramon:src/mongo/db/storage/wiredtiger/wiredtiger_parameters.cpp:2
-:ramon:src/mongo/db/storage/wiredtiger/wiredtiger_record_store.cpp:23
-:ramon:src/mongo/db/storage/wiredtiger/wiredtiger_record_store.h:1
-:ramon:src/mongo/db/storage/wiredtiger/wiredtiger_record_store_mongod.cpp:7
-:ramon:src/mongo/db/storage/wiredtiger/wiredtiger_recovery_unit.cpp:5
-:ramon:src/mongo/db/storage/wiredtiger/wiredtiger_session_cache.cpp:3
-:ramon:src/mongo/db/storage/wiredtiger/wiredtiger_size_storer.cpp:3
-:ramon:src/mongo/db/storage/wiredtiger/wiredtiger_util.cpp:5
+20160824:ramon:src/mongo/db/storage/kv/kv_catalog.cpp:7
+20160824:ramon:src/mongo/db/storage/kv/kv_catalog.h:1
+20160824:ramon:src/mongo/db/storage/kv/kv_database_catalog_entry.cpp:17
+20160824:ramon:src/mongo/db/storage/kv/kv_database_catalog_entry_get_index.cpp:2
+20160824:ramon:src/mongo/db/storage/kv/kv_storage_engine.cpp:2
+20160824:ramon:src/mongo/db/storage/kv/kv_storage_engine.h:2
+20160824:ramon:src/mongo/db/storage/mmap_v1/aligned_builder.cpp:3
+20160824:ramon:src/mongo/db/storage/mmap_v1/btree/btree_logic.cpp:27
+20160824:ramon:src/mongo/db/storage/mmap_v1/btree/btree_ondisk.cpp:1
+20160824:ramon:src/mongo/db/storage/mmap_v1/btree/key.cpp:1
+20160824:ramon:src/mongo/db/storage/mmap_v1/catalog/hashtab.cpp:3
+20160824:ramon:src/mongo/db/storage/mmap_v1/catalog/namespace_details_collection_entry.cpp:1
+20160824:ramon:src/mongo/db/storage/mmap_v1/catalog/namespace_index.cpp:4
+20160824:ramon:src/mongo/db/storage/mmap_v1/data_file.cpp:3
+20160824:ramon:src/mongo/db/storage/mmap_v1/data_file_sync.cpp:4
+20160824:ramon:src/mongo/db/storage/mmap_v1/dur.cpp:32
+20160824:ramon:src/mongo/db/storage/mmap_v1/dur_commitjob.cpp:1
+20160824:ramon:src/mongo/db/storage/mmap_v1/dur_journal.cpp:41
+20160824:ramon:src/mongo/db/storage/mmap_v1/dur_journal_writer.cpp:10
+20160824:ramon:src/mongo/db/storage/mmap_v1/dur_preplogbuffer.cpp:2
+20160824:ramon:src/mongo/db/storage/mmap_v1/dur_recover.cpp:31
+20160824:ramon:src/mongo/db/storage/mmap_v1/dur_recovery_unit.cpp:7
+20160824:ramon:src/mongo/db/storage/mmap_v1/durable_mapped_file.cpp:8
+20160824:ramon:src/mongo/db/storage/mmap_v1/durop.cpp:4
+20160824:ramon:src/mongo/db/storage/mmap_v1/file_allocator.cpp:13
+20160824:ramon:src/mongo/db/storage/mmap_v1/logfile.cpp:4
+20160824:ramon:src/mongo/db/storage/mmap_v1/mmap.cpp:3
+20160824:ramon:src/mongo/db/storage/mmap_v1/mmap_posix.cpp:14
+20160824:ramon:src/mongo/db/storage/mmap_v1/mmap_v1_database_catalog_entry.cpp:6
+20160824:ramon:src/mongo/db/storage/mmap_v1/mmap_v1_engine.cpp:20
+20160824:ramon:src/mongo/db/storage/mmap_v1/mmap_v1_extent_manager.cpp:9
+20160824:ramon:src/mongo/db/storage/mmap_v1/mmap_windows.cpp:11
+20160824:ramon:src/mongo/db/storage/mmap_v1/record_store_v1_base.cpp:1
+20160824:ramon:src/mongo/db/storage/mmap_v1/record_store_v1_capped.cpp:2
+20160824:ramon:src/mongo/db/storage/mmap_v1/record_store_v1_repair_iterator.cpp:5
+20160824:ramon:src/mongo/db/storage/mmap_v1/record_store_v1_simple.cpp:11
+20160824:ramon:src/mongo/db/storage/mmap_v1/repair_database.cpp:7
+20160824:ramon:src/mongo/db/storage/paths.cpp:6
+20160824:ramon:src/mongo/db/storage/storage_engine_lock_file_posix.cpp:2
+20160824:ramon:src/mongo/db/storage/storage_engine_lock_file_windows.cpp:2
+20160824:ramon:src/mongo/db/storage/storage_engine_metadata.cpp:1
+20160824:ramon:src/mongo/db/storage/wiredtiger/wiredtiger_global_options.cpp:3
+20160824:ramon:src/mongo/db/storage/wiredtiger/wiredtiger_index.cpp:14
+20160824:ramon:src/mongo/db/storage/wiredtiger/wiredtiger_init.cpp:1
+20160824:ramon:src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp:19
+20160824:ramon:src/mongo/db/storage/wiredtiger/wiredtiger_parameters.cpp:2
+20160824:ramon:src/mongo/db/storage/wiredtiger/wiredtiger_record_store.cpp:23
+20160824:ramon:src/mongo/db/storage/wiredtiger/wiredtiger_record_store.h:1
+20160824:ramon:src/mongo/db/storage/wiredtiger/wiredtiger_record_store_mongod.cpp:7
+20160824:ramon:src/mongo/db/storage/wiredtiger/wiredtiger_recovery_unit.cpp:5
+20160824:ramon:src/mongo/db/storage/wiredtiger/wiredtiger_session_cache.cpp:3
+20160824:ramon:src/mongo/db/storage/wiredtiger/wiredtiger_size_storer.cpp:3
+20160824:ramon:src/mongo/db/storage/wiredtiger/wiredtiger_util.cpp:5
20160713:dan:src/mongo/db/ttl.cpp:14
20160713:dan:src/mongo/db/write_concern.cpp:1
20160713:dan:src/mongo/executor/async_mock_stream_factory.cpp:5
diff --git a/src/mongo/db/storage/mmap_v1/btree/btree_logic.cpp b/src/mongo/db/storage/mmap_v1/btree/btree_logic.cpp
index 5a3914ea072..b102d6f1b73 100644
--- a/src/mongo/db/storage/mmap_v1/btree/btree_logic.cpp
+++ b/src/mongo/db/storage/mmap_v1/btree/btree_logic.cpp
@@ -1872,7 +1872,7 @@ void BtreeLogic<BtreeLayout>::dumpBucket(const BucketType* bucket, int indentLen
string ks = k.data.toString();
log() << " " << hex << k.prevChildBucket.getOfs() << "<-- prevChildBucket for " << i
<< '\n';
- log() << indent << " " << i << ' ' << ks.substr(0, 30)
+ log() << indent << " " << i << ' ' << redact(ks.substr(0, 30))
<< " Loc:" << k.recordLoc.toString() << dec;
if (getKeyHeader(bucket, i).isUnused()) {
log() << " UNUSED";
@@ -2109,7 +2109,7 @@ void BtreeLogic<BtreeLayout>::assertValid(const std::string& ns,
log() << "ERROR: btree key order corrupt. Keys:" << endl;
if (++nDumped < 5) {
for (int j = 0; j < bucket->n; j++) {
- log() << " " << getFullKey(bucket, j).data.toString() << endl;
+ log() << " " << redact(getFullKey(bucket, j).data.toString()) << endl;
}
dumpBucket(bucket);
}
@@ -2118,9 +2118,9 @@ void BtreeLogic<BtreeLayout>::assertValid(const std::string& ns,
} else if (z == 0) {
if (!(firstKey.header.recordLoc < secondKey.header.recordLoc)) {
log() << "ERROR: btree key order corrupt (recordlocs wrong):" << endl;
- log() << " k(" << i << ")" << firstKey.data.toString()
+ log() << " k(" << i << ")" << redact(firstKey.data.toString())
<< " RL:" << firstKey.header.recordLoc.toString() << endl;
- log() << " k(" << i + 1 << ")" << secondKey.data.toString()
+ log() << " k(" << i + 1 << ")" << redact(secondKey.data.toString())
<< " RL:" << secondKey.header.recordLoc.toString() << endl;
wassert(firstKey.header.recordLoc < secondKey.header.recordLoc);
}
diff --git a/src/mongo/db/storage/mmap_v1/dur.cpp b/src/mongo/db/storage/mmap_v1/dur.cpp
index 20c2384197c..480a6d34a89 100644
--- a/src/mongo/db/storage/mmap_v1/dur.cpp
+++ b/src/mongo/db/storage/mmap_v1/dur.cpp
@@ -644,15 +644,16 @@ static void remapPrivateView(double fraction) {
LOG(4) << "remapPrivateView end";
return;
} catch (DBException& e) {
- severe() << "dbexception in remapPrivateView causing immediate shutdown: " << e.toString();
+ severe() << "dbexception in remapPrivateView causing immediate shutdown: " << redact(e);
} catch (std::ios_base::failure& e) {
severe() << "ios_base exception in remapPrivateView causing immediate shutdown: "
- << e.what();
+ << redact(e.what());
} catch (std::bad_alloc& e) {
severe() << "bad_alloc exception in remapPrivateView causing immediate shutdown: "
- << e.what();
+ << redact(e.what());
} catch (std::exception& e) {
- severe() << "exception in remapPrivateView causing immediate shutdown: " << e.what();
+ severe() << "exception in remapPrivateView causing immediate shutdown: "
+ << redact(e.what());
} catch (...) {
severe() << "unknown exception in remapPrivateView causing immediate shutdown: ";
}
@@ -846,16 +847,18 @@ static void durThread(ClockSource* cs, int64_t serverStartMs) {
LOG(4) << "groupCommit end";
} catch (DBException& e) {
- severe() << "dbexception in durThread causing immediate shutdown: " << e.toString();
+ severe() << "dbexception in durThread causing immediate shutdown: " << redact(e);
invariant(false);
} catch (std::ios_base::failure& e) {
- severe() << "ios_base exception in durThread causing immediate shutdown: " << e.what();
+ severe() << "ios_base exception in durThread causing immediate shutdown: "
+ << redact(e.what());
invariant(false);
} catch (std::bad_alloc& e) {
- severe() << "bad_alloc exception in durThread causing immediate shutdown: " << e.what();
+ severe() << "bad_alloc exception in durThread causing immediate shutdown: "
+ << redact(e.what());
invariant(false);
} catch (std::exception& e) {
- severe() << "exception in durThread causing immediate shutdown: " << e.what();
+ severe() << "exception in durThread causing immediate shutdown: " << redact(e.what());
invariant(false);
} catch (...) {
severe() << "unhandled exception in durThread causing immediate shutdown";
@@ -887,10 +890,10 @@ void startup(ClockSource* cs, int64_t serverStartMs) {
try {
replayJournalFilesAtStartup();
} catch (DBException& e) {
- severe() << "dbexception during recovery: " << e.toString();
+ severe() << "dbexception during recovery: " << redact(e);
throw;
} catch (std::exception& e) {
- severe() << "std::exception during recovery: " << e.what();
+ severe() << "std::exception during recovery: " << redact(e.what());
throw;
} catch (...) {
severe() << "exception during recovery";
diff --git a/src/mongo/db/storage/mmap_v1/dur_journal.cpp b/src/mongo/db/storage/mmap_v1/dur_journal.cpp
index 91a6d6fd569..e978e7e8e11 100644
--- a/src/mongo/db/storage/mmap_v1/dur_journal.cpp
+++ b/src/mongo/db/storage/mmap_v1/dur_journal.cpp
@@ -125,7 +125,7 @@ void journalingFailure(const char* msg) {
(2) make an indicator in the journal dir that something bad happened.
(2b) refuse to do a recovery startup if that is there without manual override.
*/
- log() << "journaling failure/error: " << msg << endl;
+ log() << "journaling failure/error: " << redact(msg) << endl;
verify(false);
}
diff --git a/src/mongo/db/storage/mmap_v1/dur_journal_writer.cpp b/src/mongo/db/storage/mmap_v1/dur_journal_writer.cpp
index 2db538c17f2..4eb0b4ea16b 100644
--- a/src/mongo/db/storage/mmap_v1/dur_journal_writer.cpp
+++ b/src/mongo/db/storage/mmap_v1/dur_journal_writer.cpp
@@ -251,8 +251,7 @@ void JournalWriter::_journalWriterThread() {
_applyToDataFilesNotify->notifyAll(buffer->_commitNumber);
}
} catch (const DBException& e) {
- severe() << "dbexception in journalWriterThread causing immediate shutdown: "
- << e.toString();
+ severe() << "dbexception in journalWriterThread causing immediate shutdown: " << redact(e);
invariant(false);
} catch (const std::ios_base::failure& e) {
severe() << "ios_base exception in journalWriterThread causing immediate shutdown: "
@@ -263,7 +262,8 @@ void JournalWriter::_journalWriterThread() {
<< e.what();
invariant(false);
} catch (const std::exception& e) {
- severe() << "exception in journalWriterThread causing immediate shutdown: " << e.what();
+ severe() << "exception in journalWriterThread causing immediate shutdown: "
+ << redact(e.what());
invariant(false);
} catch (...) {
severe() << "unhandled exception in journalWriterThread causing immediate shutdown";
diff --git a/src/mongo/db/storage/mmap_v1/dur_recover.cpp b/src/mongo/db/storage/mmap_v1/dur_recover.cpp
index 15e7e994b38..835264ec864 100644
--- a/src/mongo/db/storage/mmap_v1/dur_recover.cpp
+++ b/src/mongo/db/storage/mmap_v1/dur_recover.cpp
@@ -345,7 +345,7 @@ void RecoveryJob::applyEntry(Last& last, const ParsedJournalEntry& entry, bool a
ss << setw(2) << entry.e->getFileNo();
ss << ' ' << setw(6) << entry.e->len << ' '
<< /*hex << setw(8) << (size_t) fqe.srcData << dec <<*/
- " " << hexdump(entry.e->srcData(), entry.e->len);
+ " " << redact(hexdump(entry.e->srcData(), entry.e->len));
log() << ss.str() << endl;
}
if (apply) {
@@ -354,7 +354,7 @@ void RecoveryJob::applyEntry(Last& last, const ParsedJournalEntry& entry, bool a
} else if (entry.op) {
// a DurOp subclass operation
if (dump) {
- log() << " OP " << entry.op->toString() << endl;
+ log() << " OP " << redact(entry.op->toString()) << endl;
}
if (apply) {
if (entry.op->needFilesClosed()) {
diff --git a/src/mongo/db/storage/mmap_v1/dur_recovery_unit.cpp b/src/mongo/db/storage/mmap_v1/dur_recovery_unit.cpp
index 0c9f58988e2..2b235f71961 100644
--- a/src/mongo/db/storage/mmap_v1/dur_recovery_unit.cpp
+++ b/src/mongo/db/storage/mmap_v1/dur_recovery_unit.cpp
@@ -188,7 +188,7 @@ void DurRecoveryUnit::rollbackChanges() {
try {
for (int i = _changes.size() - 1; i >= 0; i--) {
- LOG(2) << "CUSTOM ROLLBACK " << demangleName(typeid(*_changes[i]));
+ LOG(2) << "CUSTOM ROLLBACK " << redact(demangleName(typeid(*_changes[i])));
_changes[i]->rollback();
}
} catch (...) {
diff --git a/src/mongo/db/storage/mmap_v1/durable_mapped_file.cpp b/src/mongo/db/storage/mmap_v1/durable_mapped_file.cpp
index ff8add6cb91..c7b89102fca 100644
--- a/src/mongo/db/storage/mmap_v1/durable_mapped_file.cpp
+++ b/src/mongo/db/storage/mmap_v1/durable_mapped_file.cpp
@@ -156,7 +156,7 @@ __declspec(noinline) void PointerToDurableMappedFile::makeChunkWritable(size_t c
p.getExtraInfo(bb);
severe() << "MongoDB has exhausted the system memory capacity.";
- severe() << "Current Memory Status: " << bb.obj().toString();
+ severe() << "Current Memory Status: " << bb.obj();
}
severe() << "VirtualProtect for " << mmf->filename() << " chunk " << chunkno
diff --git a/src/mongo/db/storage/mmap_v1/record_store_v1_base.cpp b/src/mongo/db/storage/mmap_v1/record_store_v1_base.cpp
index 7950922afd7..fb3f101e172 100644
--- a/src/mongo/db/storage/mmap_v1/record_store_v1_base.cpp
+++ b/src/mongo/db/storage/mmap_v1/record_store_v1_base.cpp
@@ -728,7 +728,7 @@ Status RecordStoreV1Base::validate(OperationContext* txn,
results->errors.push_back("invalid object detected (see logs)");
nInvalid++;
- log() << "Invalid object detected in " << _ns << ": " << status.reason();
+ log() << "Invalid object detected in " << _ns << ": " << redact(status);
} else {
bsonLen += dataSize;
}
diff --git a/src/mongo/db/storage/mmap_v1/repair_database.cpp b/src/mongo/db/storage/mmap_v1/repair_database.cpp
index 7de8e632971..6b4284ee57a 100644
--- a/src/mongo/db/storage/mmap_v1/repair_database.cpp
+++ b/src/mongo/db/storage/mmap_v1/repair_database.cpp
@@ -257,7 +257,7 @@ public:
MONGO_ASSERT_ON_EXCEPTION(boost::filesystem::remove_all(_path));
} catch (DBException& e) {
- error() << "RepairFileDeleter failed to cleanup: " << e;
+ error() << "RepairFileDeleter failed to cleanup: " << redact(e);
error() << "aborting";
fassertFailed(17402);
}
diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_index.cpp b/src/mongo/db/storage/wiredtiger/wiredtiger_index.cpp
index aa3d6277260..45f96c5040d 100644
--- a/src/mongo/db/storage/wiredtiger/wiredtiger_index.cpp
+++ b/src/mongo/db/storage/wiredtiger/wiredtiger_index.cpp
@@ -879,9 +879,9 @@ protected:
if (nextNotIncreasing) {
// Our new key is less than the old key which means the next call moved to !next.
- log() << "WTIndex::updatePosition -- the new key ( " << toHex(item.data, item.size)
- << ") is less than the previous key (" << _key.toString()
- << "), which is a bug.";
+ log() << "WTIndex::updatePosition -- the new key ( "
+ << redact(toHex(item.data, item.size)) << ") is less than the previous key ("
+ << redact(_key.toString()) << "), which is a bug.";
// Force a retry of the operation from our last known position by acting as-if
// we received a WT_ROLLBACK error.
@@ -960,7 +960,7 @@ public:
if (!br.atEof()) {
severe() << "Unique index cursor seeing multiple records for key "
- << curr(kWantKey)->key;
+ << redact(curr(kWantKey)->key);
fassertFailed(28608);
}
}
@@ -1125,7 +1125,7 @@ void WiredTigerIndexUnique::_unindex(WT_CURSOR* c,
}
if (!foundId) {
- warning().stream() << id << " not found in the index for key " << key;
+ warning().stream() << id << " not found in the index for key " << redact(key);
return; // nothing to do
}
diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_recovery_unit.cpp b/src/mongo/db/storage/wiredtiger/wiredtiger_recovery_unit.cpp
index 4b85a47c304..d02452ff1f0 100644
--- a/src/mongo/db/storage/wiredtiger/wiredtiger_recovery_unit.cpp
+++ b/src/mongo/db/storage/wiredtiger/wiredtiger_recovery_unit.cpp
@@ -111,7 +111,7 @@ void WiredTigerRecoveryUnit::_abort() {
it != end;
++it) {
Change* change = *it;
- LOG(2) << "CUSTOM ROLLBACK " << demangleName(typeid(*change));
+ LOG(2) << "CUSTOM ROLLBACK " << redact(demangleName(typeid(*change)));
change->rollback();
}
_changes.clear();
diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_size_storer.cpp b/src/mongo/db/storage/wiredtiger/wiredtiger_size_storer.cpp
index 89d7438ea9a..509fc339c34 100644
--- a/src/mongo/db/storage/wiredtiger/wiredtiger_size_storer.cpp
+++ b/src/mongo/db/storage/wiredtiger/wiredtiger_size_storer.cpp
@@ -154,7 +154,7 @@ void WiredTigerSizeStorer::fillCache() {
std::string uriKey(reinterpret_cast<const char*>(key.data), key.size);
BSONObj data(reinterpret_cast<const char*>(value.data));
- LOG(2) << "WiredTigerSizeStorer::loadFrom " << uriKey << " -> " << data;
+ LOG(2) << "WiredTigerSizeStorer::loadFrom " << uriKey << " -> " << redact(data);
Entry& e = m[uriKey];
e.numRecords = data["numRecords"].safeNumberLong();
@@ -214,7 +214,7 @@ void WiredTigerSizeStorer::syncCache(bool syncToDisk) {
data = b.obj();
}
- LOG(2) << "WiredTigerSizeStorer::storeInto " << uriKey << " -> " << data;
+ LOG(2) << "WiredTigerSizeStorer::storeInto " << uriKey << " -> " << redact(data);
WiredTigerItem key(uriKey.c_str(), uriKey.size());
WiredTigerItem value(data.objdata(), data.objsize());
diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_util.cpp b/src/mongo/db/storage/wiredtiger/wiredtiger_util.cpp
index ed3c2aecf8d..44ca755d63c 100644
--- a/src/mongo/db/storage/wiredtiger/wiredtiger_util.cpp
+++ b/src/mongo/db/storage/wiredtiger/wiredtiger_util.cpp
@@ -352,7 +352,7 @@ int mdb_handle_error(WT_EVENT_HANDLER* handler,
int errorCode,
const char* message) {
try {
- error() << "WiredTiger (" << errorCode << ") " << message;
+ error() << "WiredTiger error (" << errorCode << ") " << redact(message);
fassert(28558, errorCode != WT_PANIC);
} catch (...) {
std::terminate();
@@ -362,7 +362,7 @@ int mdb_handle_error(WT_EVENT_HANDLER* handler,
int mdb_handle_message(WT_EVENT_HANDLER* handler, WT_SESSION* session, const char* message) {
try {
- log() << "WiredTiger " << message;
+ log() << "WiredTiger message " << redact(message);
} catch (...) {
std::terminate();
}
@@ -374,7 +374,7 @@ int mdb_handle_progress(WT_EVENT_HANDLER* handler,
const char* operation,
uint64_t progress) {
try {
- log() << "WiredTiger progress " << operation << " " << progress;
+ log() << "WiredTiger progress " << redact(operation) << " " << progress;
} catch (...) {
std::terminate();
}