[CDRIVER-2572] Only enable counters for shared memory Created: 27/Mar/18  Updated: 28/Oct/23  Resolved: 19/Apr/18

Status: Closed
Project: C Driver
Component/s: tests
Affects Version/s: None
Fix Version/s: 1.10.0

Type: Improvement Priority: Major - P3
Reporter: A. Jesse Jiryu Davis Assignee: Kevin Albertson
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by CDRIVER-2502 Rewrite mongoc_cursor_t Closed
Related
related to PHPC-1174 Upgrade bundled libbson and libmongoc... Closed

 Description   

The shared memory counters fall back to using a regular malloc'ed segment when shared memory is not available. This doesn't seem useful, and means we do an atomic increment every time an operation does an update. So instead, if shared memory segments aren't available, the counters should do nothing.

Additionally, we don't have any tests that I'm aware of for the contents of the shared-memory counters. So if we introduce bugs in incrementing the number of active cursors or the number of commands executed, etc., we won't catch it. Create some basic tests that counters are correctly incremented and decremented in response to driver events.



 Comments   
Comment by Githook User [ 23/Apr/18 ]

Author:

{'email': 'kevin.albertson@10gen.com', 'username': 'kevinAlbs', 'name': 'Kevin Albertson'}

Message: CDRIVER-2572 cfg flags for trace and counters
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/8ff2b68b57bb57a8bc66a368c14c88d77356d8f3

Comment by Githook User [ 20/Apr/18 ]

Author:

{'email': 'kevin.albertson@10gen.com', 'username': 'kevinAlbs', 'name': 'Kevin Albertson'}

Message: CDRIVER-2572 remove unnecessary config flag
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/86264e652dc648ab8c3522c39f4d9f3160b6d3b5

Comment by Githook User [ 19/Apr/18 ]

Author:

{'email': 'kevin.albertson@10gen.com', 'username': 'kevinAlbs', 'name': 'Kevin Albertson'}

Message: CDRIVER-2572 fix tests
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/56c21826a84624d1a8a25476d5ae8605d5eae556

Comment by Githook User [ 19/Apr/18 ]

Author:

{'email': 'kevin.albertson@10gen.com', 'username': 'kevinAlbs', 'name': 'Kevin Albertson'}

Message: CDRIVER-2572 fix counters and add tests
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/7ba7956ab57b3edeaa2973911999b26550714e12

Comment by Githook User [ 19/Apr/18 ]

Author:

{'email': 'kevin.albertson@10gen.com', 'username': 'kevinAlbs', 'name': 'Kevin Albertson'}

Message: CDRIVER-2572 disable counters if unsupported

Counters have a fallback to use a malloc'ed segment of memory if
shared memory isn't available. This isn't useful and adds
unnecessary overhead. If at compile-time counters cannot be enabled,
then remove them entirely.
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/5175e83bd6d4bc00b8462550301f7b41c86f2dcf

Comment by Kevin Albertson [ 29/Mar/18 ]

Going to do this as a dependency of refactoring cursor code.

Generated at Wed Feb 07 21:15:38 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.