[SERVER-22247] Parsing old config.collection documents fails because of missing 'lastmodEpoch' field Created: 20/Jan/16  Updated: 23/Nov/16  Resolved: 21/Jan/16

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: 3.2.1, 3.3.0
Fix Version/s: 3.2.3, 3.3.1

Type: Bug Priority: Major - P3
Reporter: Kaloian Manassiev Assignee: Kaloian Manassiev
Resolution: Done Votes: 0
Labels: code-and-test
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Duplicate
Related
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Completed:
Sprint: Sharding F (01/29/16)
Participants:
Linked BF Score: 0

 Description   

The 'lastmodEpoch' field in the collection document specifies the collection's creation epoch. It is used to differentiate requests for the same collection name in the cases where the collection was dropped and immediately recreated.

This field was introduced in version 2.2, so collection metadata from earlier versions will not have it. Upgrades do not add this field, so 3.2 mongos reading such legacy metadata will start failing with the following error:

error while parsing config.collections document: { _id: "dbname.collname", lastmod: new Date(1369013796), dropped: true } : NoSuchKey Missing expected field "lastmodEpoch"

We should make 'lastmodEpoch' an optional field during collection metadata parsing.



 Comments   
Comment by Githook User [ 21/Jan/16 ]

Author:

{u'username': u'kaloianm', u'name': u'Kaloian Manassiev', u'email': u'kaloian.manassiev@mongodb.com'}

Message: SERVER-22247 Fix clang compile error
Branch: v3.2
https://github.com/mongodb/mongo/commit/a06749d784cef76d1b090449927a579bc8f1191b

Comment by Githook User [ 21/Jan/16 ]

Author:

{u'username': u'kaloianm', u'name': u'Kaloian Manassiev', u'email': u'kaloian.manassiev@mongodb.com'}

Message: SERVER-22247 Fix clang compile error
Branch: master
https://github.com/mongodb/mongo/commit/ab315e0b2a2b7d15e1aad8632ab64a5a9409215f

Comment by Githook User [ 21/Jan/16 ]

Author:

{u'username': u'kaloianm', u'name': u'Kaloian Manassiev', u'email': u'kaloian.manassiev@mongodb.com'}

Message: SERVER-22247 Do not fail when parsing pre-2.2 sharding collection metadata
Branch: v3.2
https://github.com/mongodb/mongo/commit/040efca71bd822b7ad3b0fb5149e6a5bd04ecb16

Comment by Githook User [ 21/Jan/16 ]

Author:

{u'username': u'kaloianm', u'name': u'Kaloian Manassiev', u'email': u'kaloian.manassiev@mongodb.com'}

Message: SERVER-22247 Do not fail when parsing pre-2.2 sharding collection metadata
Branch: master
https://github.com/mongodb/mongo/commit/cdbcef1a5f509a0677b0bdc6a74be1c82d39b9e2

Generated at Thu Feb 08 03:59:50 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.