[SERVER-23116] Add versioning scheme to the KVCatalog to handle upgrade/downgrade with new 3.4 features Created: 14/Mar/16  Updated: 17/May/21  Resolved: 24/May/16

Status: Closed
Project: Core Server
Component/s: Storage
Affects Version/s: None
Fix Version/s: 3.2.7, 3.3.8

Type: Task Priority: Major - P3
Reporter: Max Hirschhorn Assignee: Max Hirschhorn
Resolution: Done Votes: 0
Labels: code-and-test
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-24097 Add special handling for --repair and... Closed
is depended on by SERVER-23117 Remove path-level multikey informatio... Closed
is depended on by SERVER-24095 Set a feature bit in the KVCatalog wh... Closed
Related
related to SERVER-24313 Not all callers of KVCatalog::Feature... Closed
related to SERVER-23761 Prevent users from downgrading 3.4=>3... Closed
related to SERVER-56929 Improve error message for improper do... Closed
Backwards Compatibility: Fully Compatible
Backport Completed:
Sprint: Query 13 (04/22/16), Query 14 (05/13/16), Query 15 (06/03/16)
Participants:

 Description   

The KVCatalog::FeatureTracker manages a document in the KVCatalog of the following form

{
    isFeatureDoc:  true,
    ns:            null,
    repairable:    0b0000...0000,  // 64 bits
    nonRepairable: 0b0000...0000,  // 64 bits
}

The "ns" field has a value of null in order to make calls to obj["ns"].String() in KVCatalog::init() massert on versions of MongoDB earlier than the fixVersion of SERVER-23117.

A version of mongod will fail to start up if an unrecognized feature is marked as in-use on the data files. This allows a breaking change to be made between two major versions of MongoDB and require users to downgrade to a newer version of the older major release in order to be able to downgrade cleanly. The feature document is inserted into the KVCatalog only after the first feature is enabled on the data files, e.g. the feature document will be inserted when a new index is created after upgrading to 3.4 (SERVER-24095).

The distinction between the "repairable" and "nonRepairable" feature bits is that special handling (SERVER-24097) could be done for the "repairable" feature bits when the mongod is started with --repair, e.g. if the feature only affects indexes and not collection data.



 Comments   
Comment by Githook User [ 27/May/16 ]

Author:

{u'username': u'visemet', u'name': u'Max Hirschhorn', u'email': u'max.hirschhorn@mongodb.com'}

Message: SERVER-23116 Skip over the feature document when listing all the idents.

(cherry picked from commit dbbb77673cc252517aa1222fed1981c5a12e89cd)
Branch: v3.2
https://github.com/mongodb/mongo/commit/54d2b72a8d9a375be82b4e74408eb18dfb8ce2b1

Comment by Githook User [ 27/May/16 ]

Author:

{u'username': u'milkie', u'name': u'Eric Milkie', u'email': u'milkie@10gen.com'}

Message: SERVER-23116 remove pessimizing moves

(cherry picked from commit 68d2943e7eebb0c969567f6435f71b39a336a1a2)
Branch: v3.2
https://github.com/mongodb/mongo/commit/852661e1eda6d4b46686a2f0a0d2cc85a1d0499f

Comment by Githook User [ 27/May/16 ]

Author:

{u'username': u'visemet', u'name': u'Max Hirschhorn', u'email': u'max.hirschhorn@mongodb.com'}

Message: SERVER-23116 Add versioning scheme to the KVCatalog.

The feature document is inserted into the KVCatalog only after the first
feature is enabled on the data files.

(cherry picked from commit 77d99b27649d4f81302fde2cb7cd7f4967b9646c)

This commit differs slightly from
77d99b27649d4f81302fde2cb7cd7f4967b9646c in order to handle the
StatusWith<RecordId> returned by RecordStore::updateRecord().
Branch: v3.2
https://github.com/mongodb/mongo/commit/122c68170adc1dd8bb50a98436a92aacaf7b6e00

Comment by Githook User [ 27/May/16 ]

Author:

{u'username': u'visemet', u'name': u'Max Hirschhorn', u'email': u'max.hirschhorn@mongodb.com'}

Message: SERVER-23116 Change currentFilesCompatible() to return a Status.

(cherry picked from commit 07b62ebc131c720b29d3a76dabe950e3935fbcc1)

Conflicts:
src/mongo/base/error_codes.err
src/mongo/db/db.cpp
src/mongo/db/storage/mmap_v1/mmap_v1_database_catalog_entry.cpp
Branch: v3.2
https://github.com/mongodb/mongo/commit/55f6baf3247532d0f40337fcbeb04e935c978b5b

Comment by Githook User [ 24/May/16 ]

Author:

{u'username': u'visemet', u'name': u'Max Hirschhorn', u'email': u'max.hirschhorn@mongodb.com'}

Message: SERVER-23116 Skip over the feature document when listing all the idents.
Branch: master
https://github.com/mongodb/mongo/commit/dbbb77673cc252517aa1222fed1981c5a12e89cd

Comment by Max Hirschhorn [ 21/May/16 ]

Reopening to address a gap found while working on SERVER-23117 and SERVER-24095. KVCatalog::getAllIdents() needs to skip over the feature document when iterating over the records in the KVCatalog because it doesn't have an "ident" field.

Comment by Githook User [ 17/May/16 ]

Author:

{u'username': u'milkie', u'name': u'Eric Milkie', u'email': u'milkie@10gen.com'}

Message: SERVER-23116 remove pessimizing moves
Branch: master
https://github.com/mongodb/mongo/commit/68d2943e7eebb0c969567f6435f71b39a336a1a2

Comment by Githook User [ 17/May/16 ]

Author:

{u'username': u'visemet', u'name': u'Max Hirschhorn', u'email': u'max.hirschhorn@mongodb.com'}

Message: SERVER-23116 Add versioning scheme to the KVCatalog.

The feature document is inserted into the KVCatalog only after the first
feature is enabled on the data files.
Branch: master
https://github.com/mongodb/mongo/commit/77d99b27649d4f81302fde2cb7cd7f4967b9646c

Comment by Githook User [ 17/May/16 ]

Author:

{u'username': u'visemet', u'name': u'Max Hirschhorn', u'email': u'max.hirschhorn@mongodb.com'}

Message: SERVER-23116 Change currentFilesCompatible() to return a Status.
Branch: master
https://github.com/mongodb/mongo/commit/07b62ebc131c720b29d3a76dabe950e3935fbcc1

Generated at Thu Feb 08 04:02:25 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.