Skip to content

Instantly share code, notes, and snippets.

View DiannaHohensee's full-sized avatar

Dianna Hohensee DiannaHohensee

View GitHub Profile
Local Remote
no metadata no metadata
no metadata metadata
metadata metadata
metadata more metadata
metadata new epoch metadata
metadata new epoch but mixed chunk old and new versions
metadata no metadata
Local Remote
no metadata no metadata
no metadata metadata
metadata metadata
metadata more metadata
metadata new epoch metadata
metadata new epoch but mixed chunk old and new versions
metadata no metadata
Local Remote
no metadata no metadata
no metadata metadata
metadata metadata
metadata more metadata
metadata new epoch metadata
metadata new epoch but mixed chunk old and new versions
metadata no metadata
// Decide whether to handle the shard version that may have been sent along with the
// command.
bool useShardVersionProtocolAndFiltering = false;
// We do not redo shard version handling if this command was issued via the direct client.
if (!opCtx->getClient()->isInDirectClient()) {
// Only primary handles shard version in fcv 3.4.
if (serverGlobalParams.featureCompatibility.version.load() ==
ServerGlobalParams::FeatureCompatibility::Version::k34 &&
iAmPrimary) {
w/ changes and no pre-allocate
Benchmark Time CPU Iterations
----------------------------------------------------------------------------------------------------
DConcurrencyTest/BM_StdMutex/threads:1 21 ns 21 ns 29382112
DConcurrencyTest/BM_StdMutex/threads:2 68 ns 126 ns 4815998
DConcurrencyTest/BM_StdMutex/threads:4 146 ns 535 ns 1275356
DConcurrencyTest/BM_StdMutex/threads:8 172 ns 1247 ns 499720
DConcurrencyTest/BM_StdMutex/threads:16 208 ns 3132 ns 160000
DConcurrencyTest/BM_ResourceMutexShared/threads:1 179 ns 180 ns 3674763
diff --git a/src/mongo/db/session_test.cpp b/src/mongo/db/session_test.cpp
index 0b0f3c7..34d2e4c 100644
--- a/src/mongo/db/session_test.cpp
+++ b/src/mongo/db/session_test.cpp
@@ -591,6 +591,24 @@ TEST_F(SessionTest, StashAndUnstashResources) {
opCtx()->getWriteUnitOfWork()->commit();
}
+// Test that transactions will abort if locks cannot be taken immediately.
+TEST_F(SessionTest, TransactionAbortsIfLockIsUnavailable) {
@DiannaHohensee
DiannaHohensee / gist:bb633a2057833d4fb1a47a32dc13bb51
Created April 18, 2018 22:05
serverStatus_additions_for_snapshot_window
"available-snapshot-settings" : {
"cache pressure percentage threshold" : <num>.
"max available snapshots window size in seconds" : <num>,
"target available snapshots window size in seconds" : <num>,
"current available snapshots window size in seconds" : <num>,
"latest majority snapshot timestamp available" : <num>,
"oldest majority snapshot timestamp available" : <num>
}
@DiannaHohensee
DiannaHohensee / gist:69932a134f8c504b3e6a7e6b8919a637
Created April 18, 2018 22:08
serverStatus_snapshot_window_settings
"available-snapshot-settings" : {
"cache pressure percentage threshold" : <num>.
"current cache pressure percentage" : <num>,
"max available snapshots window size in seconds" : <num>,
"target available snapshots window size in seconds" : <num>,
"current available snapshots window size in seconds" : <num>,
"latest majority snapshot timestamp available" : <num>,
"oldest majority snapshot timestamp available" : <num>
}
// Just made up the strings, so they may change whenever I think of something more informative.
[5/5 (100%) 0.521s]LINK build/ninja/mongo/db/snapshot_window_util_test
FAILED: build/ninja/mongo/db/snapshot_window_util_test
/usr/bin/icerun /opt/mongodbtoolchain/v2/bin/clang++ @build/ninja/mongo/db/snapshot_window_util_test.rsp
build/ninja/mongo/db/s/libsharding.so: error: undefined reference to 'mongo::ShardServerCatalogCacheLoader::ShardServerCatalogCacheLoader(std::unique_ptr<mongo::CatalogCacheLoader, std::default_delete<mongo::CatalogCacheLoader> >)'
build/ninja/mongo/db/s/libsharding.so: error: undefined reference to 'vtable for mongo::ReadOnlyCatalogCacheLoader'
/opt/mongodbtoolchain/v2/bin/ld.gold: the vtable symbol may be undefined because the class is missing its key function
build/ninja/mongo/db/s/libsharding.so: error: undefined reference to 'mongo::ChunkSplitter::setReplicaSetMode(bool)'
build/ninja/mongo/db/s/libsharding.so: error: undefined reference to 'mongo::ChunkSplitter::get(mongo::OperationContext*)'
clang-3.9: error: linker command failed with exit code 1 (use -v to see invocation)
ni
Failing on jstests/core/txns/no_implicit_collection_creation_in_txn.js (https://github.com/mongodb/mongo/blob/fb9e6ec91f45036266e9678e4806ca5cbb318164/jstests/core/txns/no_implicit_collection_creation_in_txn.js#L91)
Code drops the collection, then proceeds to attempt to update a document taking an IX lock, which conflicts with asynchronous 2-phase drop that has the X lock.
{
....
const sessionColl = sessionDb[collName];
....
assert.commandWorked(testDB.runCommand({drop: collName, writeConcern: {w: "majority"}}));