Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-87926

timeseriesBucketingParametersHaveChanged: true gets set to false on a movePrimary

    • Type: Icon: Bug Bug
    • Resolution: Gone away
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Catalog and Routing
    • ALL
    • CAR Team 2024-08-05
    • 2

      We have a two shard cluster. Create a timeseries collection on it, and then modify the bucketing params:

      mongos> db.createCollection(
         "tscoll",
         {
            timeseries: {
               timeField: "timestamp",
               bucketMaxSpanSeconds: 100,
               bucketRoundingSeconds: 100
            }
         }
      )
      mongos> db.runCommand({
         collMod: "tscoll",
         timeseries: {
            bucketRoundingSeconds: 201,
            bucketMaxSpanSeconds: 201
         }
      })
      

      We can see that the timeseriesBucketingParametersHaveChanged is set to true:

      mongos> use admin
      mongos> db.aggregate([{$listCatalog: {}}, {$match: {name: /buckets.tscoll/}}]).pretty()
      {
      	"db" : "test",
      	"name" : "system.buckets.tscoll",
      	"type" : "collection",
      	"shard" : "shard-rs1",
      	"md" : {
      		"ns" : "test.system.buckets.tscoll",
      		"options" : {
      			...
      			"timeseries" : {
      				"timeField" : "timestamp",
      				"bucketRoundingSeconds" : 201,
      				"bucketMaxSpanSeconds" : 201
      			}
      		},
      		"indexes" : [ ],
      		"timeseriesBucketsMayHaveMixedSchemaData" : false,
      		"timeseriesBucketingParametersHaveChanged" : true
      	},
      	"idxIdent" : {
      		
      	},
      	"ns" : "test.system.buckets.tscoll",
      	"ident" : "collection-50-2538635120092599498"
      }
      

      Initiate movePrimary:

      mongos> db.adminCommand({movePrimary: 'test', to: 'shard-rs0'})
      mongos> use admin
      mongos> db.aggregate([{$listCatalog: {}}, {$match: {name: /buckets.tscoll/}}]).pretty()
      {
      	"db" : "test",
      	"name" : "system.buckets.tscoll",
      	"type" : "collection",
      	"shard" : "shard-rs0",
      	"ns" : "test.system.buckets.tscoll",
      	"ident" : "collection-59-3693464124440949550",
      	"md" : {
      		"ns" : "test.system.buckets.tscoll",
      		"options" : {
      			...
      			"clusteredIndex" : true,
      			"timeseries" : {
      				"timeField" : "timestamp",
      				"bucketRoundingSeconds" : 201,
      				"bucketMaxSpanSeconds" : 201
      			}
      		},
      		"indexes" : [ ],
      		"timeseriesBucketsMayHaveMixedSchemaData" : false,
      		"timeseriesBucketingParametersHaveChanged" : false
      	}
      }
      

      Found on base commit: cdbd4b3f1c03cac745e81f3b7d538775ce78992d

            Assignee:
            Unassigned Unassigned
            Reporter:
            vishnu.kaushik@mongodb.com Vishnu Kaushik
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: