[SERVER-64821] Change unstable to true for fields that are not meant to be included in the stable API Created: 23/Mar/22  Updated: 29/Oct/23  Resolved: 01/Apr/22

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

Type: Bug Priority: Major - P3
Reporter: Huayu Ouyang Assignee: Huayu Ouyang
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-60814 Need better way to avoid accidental a... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Repl 2022-04-04
Participants:

 Description   

We should change recordPreImages, ignoreUnknownIndexOptions, isTimeseriesNamespace, runtimeConstants to unstable: true. See explanations in comments

We may also need to add them to the IGNORE_UNSTABLE_LIST.

The changes from https://github.com/mongodb/mongo/commit/e818cd876ed3b492517400a3da3f687fbe13d8aa had added unstable:false to a number of command parameters, but recordPreImages is intentionally undocumented and only used by Realm, so it should be changed back to unstable: true. https://github.com/mongodb/mongo/blob/330c702d55b4a2cfb98dd86630c7e7820e5657c1/src/mongo/db/coll_mod.idl#L155-L160

Edit: We cannot change isTimeseriesNamespace or runtimeConstants in update and findAndModify to unstable: true at this moment because it needs to be stable to pass parsing validation in shards. See SERVER-65002



 Comments   
Comment by Githook User [ 31/Mar/22 ]

Author:

{'name': 'Huayu Ouyang', 'email': 'huayu.ouyang@mongodb.com', 'username': 'huayu-ouyang'}

Message: SERVER-64821 Change unstable to true for fields that are not meant to be included in the stable API
Branch: master
https://github.com/mongodb/mongo/commit/1abaec7ea9d00e728fb3a391643ba6ff47678f11

Comment by Huayu Ouyang [ 23/Mar/22 ]

Thanks for catching these! I'll edit the ticket to also change ignoreUnknownIndexOptions, isTimeseriesNamespace, runtimeConstants to unstable: true

Comment by Charlie Swanson [ 23/Mar/22 ]

I can confirm #3 - It looks like the write_ops.idl file diverges from the same options in the aggregate_command.idl file:

aggregate_command.idl

            let:
                description: "A document containing user-specified let parameter constants; i.e. values that do not change once computed."
                type: object_owned
                optional: true
                unstable: false
...
            runtimeConstants:
                description: "A legacy way to specify constant variables available during execution. 'let' is now preferred."
                type: LegacyRuntimeConstants
                cpp_name: legacyRuntimeConstants
                optional: true
                unstable: true

write_ops.idl

            let:
                description: "A set of user-specified constants used by pipeline-style update
                              operations and $expr."
                type: object
                optional: true
                unstable: false
            runtimeConstants:
                description: "A legacy way to specify constant variables available during execution.
                             'let' is now preferred."
                cpp_name: legacyRuntimeConstants
                type: LegacyRuntimeConstants
                optional: true
                unstable: false

'let' and 'runtimeConstants' provide the same functionality and 'let' should be preferred.

Comment by Max Hirschhorn [ 23/Mar/22 ]

I skimmed the remainder of the changes of e818cd8 and think a few more changes may be needed to reflected our documented API.

  1. ignoreUnknownIndexOptions to createIndexes isn't documented and is meant to be hidden. See also https://jira.mongodb.org/browse/SERVER-39669?focusedCommentId=2157337&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-2157337.
  2. isTimeseriesNamespace isn't documented. Based on SERVER-61685 it seems like it isn't meant to be a permanent concept for the collMod command.
  3. runtimeConstants is documented as being a "legacy" way. We should check with the Query team whether it is meant to be part of the stable API.
Generated at Thu Feb 08 06:01:13 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.