[SERVER-37555] An abort of collMod need not refreshEntry for an index on rollback Created: 10/Oct/18  Updated: 29/Oct/23  Resolved: 15/Oct/18

Status: Closed
Project: Core Server
Component/s: Catalog
Affects Version/s: 4.1.3
Fix Version/s: 4.1.5

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

Issue Links:
Depends
Related
related to SERVER-37634 Remove FCV upgrade test from setFCV_c... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Storage Engines 2018-10-22
Participants:
Linked BF Score: 45
Story Points: 3

 Description   

When a collMod operation aborts its WriteUnitOfWork, it need not call refreshEntry on rollback. An index catalog change via collMod already invoke refreshEntry. The refreshEntry itself should restore its state on rollback as it registers an IndexRemoveChange to do that.



 Comments   
Comment by Githook User [ 16/Oct/18 ]

Author:

{'name': 'nehakhatri5', 'email': 'neha.khatri@mongodb.com', 'username': 'nehakhatri5'}

Message: SERVER-37555 Fix the error code in the uassert.
Branch: master
https://github.com/mongodb/mongo/commit/44c2055cba5221732a319c27210025ce7ccab71e

Comment by Githook User [ 15/Oct/18 ]

Author:

{'name': 'nehakhatri5', 'email': 'neha.khatri@mongodb.com', 'username': 'nehakhatri5'}

Message: SERVER-37555 Abort of collMod need not refreshEntry for index on rollback.
Branch: master
https://github.com/mongodb/mongo/commit/9693ebbdb9a0098dbcd894a739218ae30238c72d

Comment by Neha Khatri [ 12/Oct/18 ]

I am able to reproduce the problem with following test and a uassert after the index update logic in collMod.

(function() {
    'use strict';
    
    const coll = db.test_coll;
    
    assert.commandWorked(db.adminCommand({setFeatureCompatibilityVersion: '4.0'}));
    
    assert.commandWorked(coll.createIndex({a: 1}, {unique: true}));
    assert.writeOK(coll.insert({_id: 0, a: 1}));
    
    assert.commandWorked(db.adminCommand({configureFailPoint: "assertAfterIndexUpdate",
        mode: "alwaysOn"}));
    try {
        assert.commandWorked(db.adminCommand({setFeatureCompatibilityVersion: '4.2'}));
    } catch (e) {
    }
})();

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