[SERVER-22324] Update findAndModify FSM workloads to handle not matching anything Created: 27/Jan/16  Updated: 18/Nov/16  Resolved: 27/Jan/16

Status: Closed
Project: Core Server
Component/s: Testing Infrastructure
Affects Version/s: None
Fix Version/s: 3.2.3, 3.3.1

Type: Bug Priority: Major - P3
Reporter: Max Hirschhorn Assignee: Max Hirschhorn
Resolution: Done Votes: 0
Labels: test-only
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Related
is related to SERVER-21499 Enable fsm_all_simultaneous.js (FSM p... Closed
is related to SERVER-22002 Do not retry findAndModify operations... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Completed:
Steps To Reproduce:

python buildscripts/resmoke.py --executor=concurrency jstests/concurrency/fsm_all_simultaneous.js --storageEngine=mmapv1

To force a yield*.js workload to be run in combination with every other FSM workload, the following patch can be applied:

diff --git a/jstests/concurrency/fsm_all_simultaneous.js b/jstests/concurrency/fsm_all_simultaneous.js
index e50e486..abe9a7d 100644
--- a/jstests/concurrency/fsm_all_simultaneous.js
+++ b/jstests/concurrency/fsm_all_simultaneous.js
@@ -16,6 +16,6 @@ var blacklist = [
     'agg_sort_external.js', // uses >100MB of data, which can overwhelm test hosts
 ].map(function(file) { return dir + '/' + file; });
 
-runWorkloadsInParallel(ls(dir).filter(function(file) {
+runWorkloadsSerially(ls(dir).filter(function(file) {
     return !Array.contains(blacklist, file);
 }));
diff --git a/jstests/concurrency/fsm_libs/runner.js b/jstests/concurrency/fsm_libs/runner.js
index 09f788a..bebf316 100644
--- a/jstests/concurrency/fsm_libs/runner.js
+++ b/jstests/concurrency/fsm_libs/runner.js
@@ -652,6 +652,7 @@ var runner = (function() {
                 bgThreadMgr.checkFailed(0);
 
                 var schedule = scheduleWorkloads(workloads, executionMode, executionOptions);
+                schedule.forEach(workloads => workloads.unshift('jstests/concurrency/fsm_workloads/yield.js'));
                 printWorkloadSchedule(schedule, bgWorkloads);
 
                 schedule.forEach(function(workloads) {

Sprint: Query F (02/01/16)
Participants:
Linked BF Score: 0

 Description   

Failures have only been observed with the findAndModify_inc.js workload. This is fallout from SERVER-22002 that was triggered by the introduction of fsm_all_simultaneous.js (SERVER-21499). Any FSM workload can now be run when the recordNeedsFetchFail failpoint is enabled and yielding is configured to occur more often due to the effects of the yield*.js workloads.

Task
Logs

[js_test:fsm_all_simultaneous] 2016-01-27T15:19:50.378+0000 ----
[js_test:fsm_all_simultaneous] 2016-01-27T15:19:50.379+0000 Workload(s) completed in 36630 ms: jstests/concurrency/fsm_workloads/plan_cache_drop_database.js jstests/concurrency/fsm_workloads/findAndModify_inc.js jstests/concurrency/fsm_workloads/indexed_insert_eval.js jstests/concurrency/fsm_workloads/distinct_projection.js jstests/concurrency/fsm_workloads/create_collection.js jstests/concurrency/fsm_workloads/update_multifield.js jstests/concurrency/fsm_workloads/indexed_insert_heterogeneous.js jstests/concurrency/fsm_workloads/indexed_insert_2d.js jstests/concurrency/fsm_workloads/yield_sort_merge.js jstests/concurrency/fsm_workloads/yield_and_hashed.js
[js_test:fsm_all_simultaneous] 2016-01-27T15:19:50.379+0000 ----
[js_test:fsm_all_simultaneous] 2016-01-27T15:19:50.380+0000
[js_test:fsm_all_simultaneous] 2016-01-27T15:19:50.380+0000
[js_test:fsm_all_simultaneous] 2016-01-27T15:19:50.380+0000 2016-01-27T15:19:50.380+0000 E QUERY    [thread1] Error: 1 thread threw
[js_test:fsm_all_simultaneous] 2016-01-27T15:19:50.380+0000
[js_test:fsm_all_simultaneous] 2016-01-27T15:19:50.381+0000         Foreground jstests/concurrency/fsm_workloads/findAndModify_inc.js
[js_test:fsm_all_simultaneous] 2016-01-27T15:19:50.381+0000         Error: [1] != [undefined] are not equal : undefined
[js_test:fsm_all_simultaneous] 2016-01-27T15:19:50.381+0000
[js_test:fsm_all_simultaneous] 2016-01-27T15:19:50.381+0000         quietlyDoAssert@jstests/concurrency/fsm_libs/assert.js:53:15
[js_test:fsm_all_simultaneous] 2016-01-27T15:19:50.381+0000         assert.eq@src/mongo/shell/assert.js:49:5
[js_test:fsm_all_simultaneous] 2016-01-27T15:19:50.381+0000         wrapAssertFn@jstests/concurrency/fsm_libs/assert.js:60:13
[js_test:fsm_all_simultaneous] 2016-01-27T15:19:50.381+0000         assertWithLevel/</assertWithLevel[fn]@jstests/concurrency/fsm_libs/assert.js:99:13
[js_test:fsm_all_simultaneous] 2016-01-27T15:19:50.382+0000         find/<@jstests/concurrency/fsm_workloads/findAndModify_inc.js:37:17
[js_test:fsm_all_simultaneous] 2016-01-27T15:19:50.382+0000         assertWithLevel/assertWithLevel@jstests/concurrency/fsm_libs/assert.js:75:1
[js_test:fsm_all_simultaneous] 2016-01-27T15:19:50.382+0000         find@jstests/concurrency/fsm_workloads/findAndModify_inc.js:35:1
[js_test:fsm_all_simultaneous] 2016-01-27T15:19:50.382+0000         runFSM@jstests/concurrency/fsm_libs/fsm.js:43:13
[js_test:fsm_all_simultaneous] 2016-01-27T15:19:50.382+0000         ____MongoToSM_newFunction_temp/<@:10:9
[js_test:fsm_all_simultaneous] 2016-01-27T15:19:50.383+0000         main@jstests/concurrency/fsm_libs/worker_thread.js:104:17
[js_test:fsm_all_simultaneous] 2016-01-27T15:19:50.383+0000         ____MongoToSM_newFunction_temp@:7:1
[js_test:fsm_all_simultaneous] 2016-01-27T15:19:50.383+0000         ____MongoToSM_newFunction_temp@:5:24
[js_test:fsm_all_simultaneous] 2016-01-27T15:19:50.383+0000
[js_test:fsm_all_simultaneous] 2016-01-27T15:19:50.383+0000  :
[js_test:fsm_all_simultaneous] 2016-01-27T15:19:50.383+0000 throwError@jstests/concurrency/fsm_libs/runner.js:332:23
[js_test:fsm_all_simultaneous] 2016-01-27T15:19:50.383+0000 runWorkloads@jstests/concurrency/fsm_libs/runner.js:705:17
[js_test:fsm_all_simultaneous] 2016-01-27T15:19:50.383+0000 parallel@jstests/concurrency/fsm_libs/runner.js:726:1
[js_test:fsm_all_simultaneous] 2016-01-27T15:19:50.384+0000 @jstests/concurrency/fsm_all_simultaneous.js:19:1
[js_test:fsm_all_simultaneous] 2016-01-27T15:19:50.384+0000
[js_test:fsm_all_simultaneous] 2016-01-27T15:19:50.384+0000 failed to load: jstests/concurrency/fsm_all_simultaneous.js



 Comments   
Comment by Githook User [ 27/Jan/16 ]

Author:

{u'username': u'visemet', u'name': u'Max Hirschhorn', u'email': u'max.hirschhorn@mongodb.com'}

Message: SERVER-22324 Update findAndModify_inc.js to handle mmapv1 invalidations.

The "findAndModify" command will return a 'value' of null if a document
is invalidated during a yield.

(cherry picked from commit b8cad6a59cbce2831e69e6b94f9544d83d6e00b0)
Branch: v3.2
https://github.com/mongodb/mongo/commit/9744b58a005e2011f8ffb106208e75d0432fa38b

Comment by Githook User [ 27/Jan/16 ]

Author:

{u'username': u'visemet', u'name': u'Max Hirschhorn', u'email': u'max.hirschhorn@mongodb.com'}

Message: SERVER-22324 Update findAndModify_inc.js to handle mmapv1 invalidations.

The "findAndModify" command will return a 'value' of null if a document
is invalidated during a yield.
Branch: master
https://github.com/mongodb/mongo/commit/b8cad6a59cbce2831e69e6b94f9544d83d6e00b0

Generated at Thu Feb 08 04:00:04 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.