[SERVER-74438] MetaField is being added to the control block of time-series buckets Created: 28/Feb/23  Updated: 29/Oct/23  Resolved: 06/Mar/23

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

Type: Bug Priority: Major - P3
Reporter: Fausto Leyva (Inactive) Assignee: Fausto Leyva (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v6.3
Steps To Reproduce:

1. 
db.adminCommand(

{setParameter: 1, timeseriesIdleBucketExpiryMemoryUsageThreshold: 1024}

)
2. db.createCollection(
"coll", {timeseries: {timeField:"time", metaField:"tag"}})
3.

 const docs = [\{"time": new Date(), "tag": i},...]; // array of 1000 measurements with increasing metaField 
4. 
assert.commandWorked(db.runCommand({insert: "coll", documents: docs, ordered: ordered}));
5.
// insert where we will reopen previous bucket

Sprint: Execution Team 2023-03-06, Execution Team 2023-03-20
Participants:

 Description   

I noticed in jstests/concurrency/fsm_workloads/timeseries_insert_idle_bucket_expiration.js we can arrive to this invalid state:

 

{
        "_id" : ObjectId("63fe115071dee89626713073"),
        "control" : {
                "version" : 1,
                "min" : {
                        "time" : ISODate("2023-02-28T14:36:00Z"),
                        "tag" : 1
                },
                "max" : {
                        "time" : ISODate("2023-02-28T14:42:42.177Z"),
                        "tag" : 1
                }
        },
        "meta" : 1,
        "data" : {
                "time" : {
                        "0" : ISODate("2023-02-28T14:36:02.572Z"),
                        "1" : ISODate("2023-02-28T14:42:42.177Z")
                }
        }
}

For some reason we are adding the metaField value to the control block. Possibly in the process of reopening buckets and inserting more measurements into it.



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

Author:

{'name': 'Faustoleyva54', 'email': 'fausto.leyva@mongodb.com', 'username': 'Faustoleyva54'}

Message: SERVER-74438 Update BucketMetadata to use time-series metadata value

(cherry picked from commit 1e217fd954eefda95d9d8f8907f077b0aa379667)
Branch: v6.3
https://github.com/mongodb/mongo/commit/e1e07f94dba858ec629172b060d321ef113c21fb

Comment by Githook User [ 06/Mar/23 ]

Author:

{'name': 'Faustoleyva54', 'email': 'fausto.leyva@mongodb.com', 'username': 'Faustoleyva54'}

Message: SERVER-74438 Update BucketMetadata to use time-series metadata value
Branch: master
https://github.com/mongodb/mongo/commit/1e217fd954eefda95d9d8f8907f077b0aa379667

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