[SERVER-60105] Inserts into timeseries collections are not observable from any opcounter Created: 21/Sep/21  Updated: 29/Oct/23  Resolved: 07/Apr/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 5.3.2, 5.0.8, 6.0.0-rc0

Type: Question Priority: Minor - P4
Reporter: Halvor Strand Assignee: Gregory Wlodarek
Resolution: Fixed Votes: 0
Labels: time-series
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File Screen Shot 2021-11-16 at 10.27.19 AM.png     File repro.js    
Issue Links:
Backports
Backwards Compatibility: Fully Compatible
Backport Requested:
v5.3, v5.0
Sprint: Execution Team 2021-11-29, Execution Team 2021-12-13, Execution Team 2021-12-27, Execution Team 2022-01-10, Execution Team 2022-01-24, Execution Team 2022-02-07, Execution Team 2022-02-21, Execution Team 2022-03-07, Execution Team 2022-04-18
Participants:

 Description   

Doing inserts into a time series does not increase the `insert` count of `mongostat`. Having a way to track these `insert`s would be a great addition.

The `net_in` column does reflect the increase in traffic, but is a bit more obfuscated as a metric for inserts.

Experienced using mongostat 100.5.0 and MongoDB 5.0.2.



 Comments   
Comment by Githook User [ 08/Apr/22 ]

Author:

{'name': 'Gregory Wlodarek', 'email': 'gregory.wlodarek@mongodb.com', 'username': 'GWlodarek'}

Message: SERVER-60105 Record time-series writes to the global OpCounter

(cherry picked from commit 0e7af76ae586749bf71928963c857cb50f760b9b)
Branch: v5.3
https://github.com/mongodb/mongo/commit/01948c4d502b61c4d34d5d91a6ed903ff305ea07

Comment by Githook User [ 08/Apr/22 ]

Author:

{'name': 'Gregory Wlodarek', 'email': 'gregory.wlodarek@mongodb.com', 'username': 'GWlodarek'}

Message: SERVER-60105 Record time-series writes to the global OpCounter

(cherry picked from commit 0e7af76ae586749bf71928963c857cb50f760b9b)
Branch: v5.0
https://github.com/mongodb/mongo/commit/f55557b31591d290835a87fa46c9ad49aab4dc36

Comment by Githook User [ 07/Apr/22 ]

Author:

{'name': 'Gregory Wlodarek', 'email': 'gregory.wlodarek@mongodb.com', 'username': 'GWlodarek'}

Message: SERVER-60105 Record time-series writes to the global OpCounter
Branch: master
https://github.com/mongodb/mongo/commit/0e7af76ae586749bf71928963c857cb50f760b9b

Comment by Edwin Zhou [ 11/Oct/21 ]

Hi halvor.holsten.strand@gmail.com,

Thanks for your report. I've been able to reproduce the issue and I will pass this on to the appropriate team for investigation.

Mon Oct 11 2021 12:26:00 GMT-0400 (EDT) ### Inserting documents to a timeseries collection ###
    *0    *0     *0     *0       0     1|0  1.9% 2.3%       0 5.38G 72.0M 0|0 1|0   112b   48.5k    2 Oct 11 12:26:00.269
    *0    *0     *0     *0       0     5|0  2.2% 2.6%       0 5.38G 74.0M 0|0 1|1   390k    157k    3 Oct 11 12:26:01.269
    *0    *0     *0     *0       0     1|0  2.7% 3.1%       0 5.39G 79.0M 0|0 1|1   377k    150k    3 Oct 11 12:26:02.269
    *0    *0     *0     *0       0     0|0  0.4% 0.9%       0 5.36G 58.0M 0|0 1|0   406k    158k    3 Oct 11 12:26:03.270
    *0    *0     *0     *0       0     1|0  0.6% 1.1%       0 5.36G 60.0M 0|0 1|0   362k    146k    3 Oct 11 12:26:04.269
 
Mon Oct 11 2021 12:26:05 GMT-0400 (EDT) ### Inserting documents to a normal collection ###
   708    *0     *0     *0       0     0|0  0.7% 1.2%       0 5.37G 61.0M 0|0 1|0   400k    160k    3 Oct 11 12:26:05.270
  3515    *0     *0     *0       0     1|0  0.7% 1.2%       0 5.37G 61.0M 0|0 1|0   562k    221k    3 Oct 11 12:26:06.269
  3315    *0     *0     *0       0     0|0  0.8% 1.3%       0 5.37G 61.0M 0|0 1|0   531k    211k    3 Oct 11 12:26:07.270
  2452    *0     *0     *0       0     2|0  0.9% 1.4%       0 5.36G 61.0M 0|0 1|0   393k    169k    2 Oct 11 12:26:08.273

Best,
Edwin

Comment by Halvor Strand [ 21/Sep/21 ]

Thanks @Tim Fogarty. I'll just add that the `update` counter also does not increase from my experience. I'd expect that counter to be higher.

Comment by Tim Fogarty [ 21/Sep/21 ]

Hi halvor.holsten.strand@gmail.com, timeseries collections are implemented as a writable non-materialized view over an internal system collection. Multiple timeseries measurements are bucketed into documents in the internal system collection. So when you insert into a timeseries collection, most of the time that will be an update to an internal bucket document, not an insert. There will only be an insert when a new bucket document is created. So I think that's why you're seeing the current behavior.

mongostat reports whatever the opcounters in the serverStatus command reports. So I'm going to move this ticket to the SERVER project. The Server Team will be able to let you know if we have any plans to change the serverStatus behavior for timeseries collections.

 

Generated at Thu Feb 08 05:48:58 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.