[SERVER-17497] Initial sync can fail due to frequently altered TTL index Created: 06/Mar/15  Updated: 02/Nov/16  Resolved: 06/Mar/15

Status: Closed
Project: Core Server
Component/s: Replication
Affects Version/s: 2.6.8
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Alexander Komyagin Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-26118 CollMod 'c' op: ignore metadata error... Closed
Related
Operating System: ALL
Participants:

 Description   

Let's assume there is a collection with a TTL index that has frequently changed expireAfterSecs parameter (via collMod).

Now if initial sync is started on a secondary, it's possible to have the following sequence of events:

  1. Secondary creates the index during the oplog syncup stage:

    [rsSync] replSet initial sync data copy, starting 
    [rsSync] oplog sync 1 of 3
    ...
    [repl index builder 1] build index on: db.col properties: { v: 1, key: { date: 1 }, name: "date_1", ns: "db.col", expireAfterSeconds: 604800, background: true }
    [repl index builder 1] 	 building index in background
    [repl index builder 1] build index done.  scanned 128 total records. 0 secs

  2. The index gets altered on the primary again, and expireAfterSeconds is changed
  3. During the index clone stage the secondary tries to clone the altered index and fails:

    [rsSync] replSet initial sync building indexes
    ...
    [rsSync] replSet initial sync cloning indexes for : db
    [rsSync] ERROR: error creating index when cloning spec: { key: { date: 1 }, name: "date_1", ns: "db.col", expireAfterSeconds: 173250, background: true } error: IndexOptionsConflict Index with name: date_1 already exists with different options
    [rsSync] replSet initial sync exception: 85 Index with name: date_1 already exists with different options 9 attempts remaining



 Comments   
Comment by Eric Milkie [ 06/Mar/15 ]

This is one of the symptoms of SERVER-9096, where new index builds are initiated on the primary during the data copy of initial sync.

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