[DOCS-842] Document what collection.stats() userFlags value will be if usePowerOf2Sizes is enabled Created: 04/Dec/12  Updated: 30/Oct/23  Resolved: 04/Dec/12

Status: Closed
Project: Documentation
Component/s: manual
Affects Version/s: None
Fix Version/s: Server_Docs_20231030

Type: Bug Priority: Major - P3
Reporter: Ian Daniel Assignee: Ed Costello
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-7733 DB file growing fast Closed
is related to DOCS-841 Extra double-quote in collMod command... Closed
Participants:
Days since reply: 11 years, 11 weeks, 1 day ago

 Description   

In http://docs.mongodb.org/manual/reference/collection-statistics/, in the userFlags section we state that the only user flag is usePowerOf2Sizes. However we do not state what the value of userFlags will be if usePowerOf2Sizes is enabled (or disabled).

From my testing, userFlags is set to 1 if usePowerOf2Sizes is enabled, and userFlags is set to 0 if usePowerOf2Sizes is disabled.



 Comments   
Comment by auto [ 04/Dec/12 ]

Author:

{u'date': u'2012-12-04T17:57:33Z', u'email': u'samk@10gen.com', u'name': u'Sam Kleinman'}

Message: merge: DOCS-842
Branch: master
https://github.com/mongodb/docs/commit/fe37eb622ac2b77b79f546bad84b3e99cee07014

Comment by auto [ 04/Dec/12 ]

Author:

{u'date': u'2012-12-04T14:54:29Z', u'email': u'epc@10gen.com', u'name': u'Ed Costello'}

Message: DOCS-842 document value of userStats
Branch: master
https://github.com/mongodb/docs/commit/a68de2aabd26387d20630496a96b1bef5b9e0205

Comment by Ed Costello [ 04/Dec/12 ]

Pushed to github.

Comment by Ed Costello [ 04/Dec/12 ]

For now I'm documenting that it's 1 if usepowerof2sizes is set. If/when there's additional userflags then we'll add commentary about needing to bitwise-and the value to determine which userflags have been set.

Comment by Eric Milkie [ 04/Dec/12 ]

The relevant code for userFlags is in namespace_details.h:194.

        enum UserFlags {
            Flag_UsePowerOf2Sizes = 1 << 0
        };

So this means the zero-th bit of UserFlags is for UsePowerOf2Sizes. The other bits in the integer are not yet assigned to any meaningful value.
To be technically correct, userFlags needs to be bitwise-anded with 1 in order to determine its UsePowerOf2Sizes value.

Generated at Thu Feb 08 07:39:38 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.