[SERVER-74755] Collection sample counters not removed atomically with sample reconfiguration Created: 10/Mar/23  Updated: 29/Oct/23  Resolved: 04/Apr/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: 7.0.0-rc0
Fix Version/s: 7.0.0-rc0

Type: Bug Priority: Major - P3
Reporter: Israel Hsu Assignee: Israel Hsu
Resolution: Fixed Votes: 0
Labels: auto-reverted
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Problem/Incident
Backwards Compatibility: Fully Compatible
Operating System: ALL
Participants:
Linked BF Score: 147
Story Points: 1

 Description   

In BF-28001, one writing thread is generating a sample ID and invokes the collection's sample counters. In another thread, query sampling on this collection is being disabled, and the collection's sample counters are removed first, and then the collection's sampling configuration is removed. Because these two removals do not happen atomically, the writing thread decides to generate a sample ID, but then an invariant is false when it cannot fetch the collection's sample counters.

The removal of a sampling configuration and the removal of the collection's sample counters must occur atomically, within QueryAnalysisSampler::_refreshConfigurations().



 Comments   
Comment by Githook User [ 20/Mar/23 ]

Author:

{'name': 'Israel Hsu', 'email': 'israel.hsu@mongodb.com', 'username': 'israelhsu'}

Message: SERVER-74755 Make QueryAnalysisSampleCounters refresh config atomic with sampler refresh
Branch: master
https://github.com/mongodb/mongo/commit/b920e7b5b6628714e49e09ff5521182a68056915

Comment by xgen-buildbaron-user [ 15/Mar/23 ]

Ticket re-opened due to revert. sharding_auth_audit began a consistent failure of jstests\sharding\analyze_shard_key\query_analysis_sample_counters_reporting.js

Comment by Githook User [ 15/Mar/23 ]

Author:

{'name': 'auto-revert-processor', 'email': 'dev-prod-dag@mongodb.com', 'username': ''}

Message: Revert "SERVER-74755 Make QueryAnalysisSampleCounters refresh config atomic with sampler refresh"

This reverts commit d21348f684ad55f39ff1fab4bdfeea4e7b1d3128.
Branch: master
https://github.com/mongodb/mongo/commit/6e25f79b5a12ebcb768297e15bf5cd9775a48d48

Comment by Githook User [ 14/Mar/23 ]

Author:

{'name': 'Israel Hsu', 'email': 'israel.hsu@mongodb.com', 'username': 'israelhsu'}

Message: SERVER-74755 Make QueryAnalysisSampleCounters refresh config atomic with sampler refresh
Branch: master
https://github.com/mongodb/mongo/commit/d21348f684ad55f39ff1fab4bdfeea4e7b1d3128

Generated at Thu Feb 08 06:28:26 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.