[SERVER-20920] ttl_capped.js should wait longer for the TTL monitor to run Created: 14/Oct/15  Updated: 27/Oct/15  Resolved: 16/Oct/15

Status: Closed
Project: Core Server
Component/s: Testing Infrastructure
Affects Version/s: 3.1.9
Fix Version/s: 3.2.0-rc1

Type: Task Priority: Minor - P4
Reporter: Max Hirschhorn Assignee: Max Hirschhorn
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Sprint: QuInt B (11/02/15)
Participants:

 Description   

Task
Logs

[js_test:ttl_capped] 2015-10-12T18:55:11.216+0000 2015-10-12T18:55:11.215+0000 E QUERY    [thread1] Error: [1] != [0] are not equal : undefined :
[js_test:ttl_capped] 2015-10-12T18:55:11.216+0000 doassert@src/mongo/shell/assert.js:15:14
[js_test:ttl_capped] 2015-10-12T18:55:11.217+0000 assert.eq@src/mongo/shell/assert.js:43:5
[js_test:ttl_capped] 2015-10-12T18:55:11.217+0000 @jstests/noPassthrough/ttl_capped.js:47:1
[js_test:ttl_capped] 2015-10-12T18:55:11.217+0000 @jstests/noPassthrough/ttl_capped.js:7:2
[js_test:ttl_capped] 2015-10-12T18:55:11.217+0000
[js_test:ttl_capped] 2015-10-12T18:55:11.218+0000 d20010| 2015-10-12T18:55:11.215+0000 I COMMAND  [conn1] command test.ttl_before command: count { count: "ttl_before", query: {}, fields: {} } planSummary: COUNT ntoreturn:1 ntoskip:0 keyUpdates:0 writeConflicts:0 numYields:0 reslen:47 locks:{ Global: { acquireCount: { r: 2 } }, MMAPV1Journal: { acquireCount: { r: 1 } }, Database: { acquireCount: { r: 1 } }, Collection: { acquireCount: { R: 1 } } } protocol:op_command 0ms
[js_test:ttl_capped] 2015-10-12T18:55:11.218+0000 failed to load: jstests/noPassthrough/ttl_capped.js

Additional failure:

Proprosal is to change ttl_capped.js to wait for TTL monitor to run by checking metrics.ttl.passes in the serverStatus response in an assert.soon().



 Comments   
Comment by Githook User [ 16/Oct/15 ]

Author:

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

Message: SERVER-20920 Wait longer for the TTL monitor to finish in ttl_capped.js.

Use db.serverStatus().metrics.ttl.passes to know when the TTL monitor
has finished processing all of the TTL indexes.

Create many collections with a TTL index to increase the odds that the
TTL monitor would process a non-capped collection after a capped
collection.
Branch: master
https://github.com/mongodb/mongo/commit/18ed396f69f27476456c7564c9b73a223b5cea16

Comment by Max Hirschhorn [ 14/Oct/15 ]

This test is also flawed because the creation order of collections doesn't necessarily correspond to the iteration order by the TTL monitor in mmapv1:

[js_test:ttl_capped] 2015-10-12T19:21:07.848+0000 d20760| 2015-10-12T19:21:07.847+0000 D INDEX    [TTLMonitor] TTL -- ns: test.ttl_capped key: { x: 1.0 }
[js_test:ttl_capped] 2015-10-12T19:21:07.848+0000 d20760| 2015-10-12T19:21:07.847+0000 I STORAGE  [TTLMonitor] failing remove on a capped ns test.ttl_capped
[js_test:ttl_capped] 2015-10-12T19:21:07.848+0000 d20760| 2015-10-12T19:21:07.847+0000 D -        [TTLMonitor] User Assertion: 10089:cannot remove from a capped collection
[js_test:ttl_capped] 2015-10-12T19:21:07.850+0000 d20760| 2015-10-12T19:21:07.849+0000 E INDEX    [TTLMonitor] Error processing ttl index: { v: 1, key: { x: 1.0 }, name: "x_1", ns: "test.ttl_capped", expireAfterSeconds: -1.0 } -- 10089 cannot remove from a capped collection
[js_test:ttl_capped] 2015-10-12T19:21:07.851+0000 d20760| 2015-10-12T19:21:07.849+0000 D INDEX    [TTLMonitor] TTL -- ns: test.ttl_before key: { x: 1.0 }
[js_test:ttl_capped] 2015-10-12T19:21:07.851+0000 d20760| 2015-10-12T19:21:07.849+0000 D INDEX    [TTLMonitor]  TTL deleted: 1
[js_test:ttl_capped] 2015-10-12T19:21:07.851+0000 d20760| 2015-10-12T19:21:07.850+0000 D INDEX    [TTLMonitor] TTL -- ns: test.ttl_zafter key: { x: 1.0 }
[js_test:ttl_capped] 2015-10-12T19:21:07.851+0000 d20760| 2015-10-12T19:21:07.850+0000 D INDEX    [TTLMonitor]  TTL deleted: 1

Generated at Thu Feb 08 03:55:42 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.