Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The defaultConsistencyLevel property should be set to the value defined in request payload while creating the restored CosmosDB Account #24607

Open
neil-yechenwei opened this issue Jun 27, 2023 · 1 comment
Labels
Cosmos Service Attention Workflow: This issue is responsible by Azure service team.

Comments

@neil-yechenwei
Copy link

neil-yechenwei commented Jun 27, 2023

Recently, we found that the defaultConsistencyLevel property isn't set to the value defined in request payload while creating the restored CosmosDB Account. This issue happens around 2023-05-19. Previously it works fine with same repro steps,which means the defaultConsistencyLevel property is able to be set to the value defined in request payload while creating the restored CosmosDB Account. So I assume it's a regression issue. Could you take a look/fix this issue asap? Thanks in advance.

Repro steps:

  1. Create the source CosmosDB Account with below "Request Payload 1".
  2. Create the restored CosmosDB Account based on above source CosmosDB Account with below "Request Payload 2".
  3. Invoke CosmosDB.Account.GET API to get the resource. You will find the defaultConsistencyLevel property isn't set to the value defined in below "Request Payload 2".

Request Payload 1 - Create source CosmosDB Account:

PUT https://management.azure.com/subscriptions/xx-xx-xx-xx/resourceGroups/acctestRG-cosmos-230627141318137548/providers/Microsoft.DocumentDB/databaseAccounts/acctest-ca-230627141318137548

{
    "identity": {
        "type": "None"
    },
    "kind": "MongoDB",
    "location": "westeurope",
    "properties": {
        "consistencyPolicy": {
            "defaultConsistencyLevel": "Eventual",
            "maxStalenessPrefix": 100,
            "maxIntervalInSeconds": 5
        },
        "locations": [
            {
                "failoverPriority": 0,
                "isZoneRedundant": false,
                "locationName": "westeurope"
            }
        ],
        "databaseAccountOfferType": "Standard",
        "ipRules": [],
        "isVirtualNetworkFilterEnabled": false,
        "enableAutomaticFailover": false,
        "capabilities": [
            {
                "name": "EnableMongo"
            }
        ],
        "virtualNetworkRules": [],
        "enableMultipleWriteLocations": false,
        "disableKeyBasedMetadataWriteAccess": false,
        "defaultIdentity": "FirstPartyIdentity",
        "publicNetworkAccess": "Enabled",
        "enableFreeTier": false,
        "enableAnalyticalStorage": false,
        "backupPolicy": {
            "type": "Continuous"
        },
        "networkAclBypass": "None",
        "networkAclBypassResourceIds": [],
        "disableLocalAuth": false
    },
    "tags": {}
}

Request Payload 2 - Create the restored CosmosDB Account based on above source CosmosDB Account:

PUT https://management.azure.com/subscriptions/xx-xx-xx-xx/resourceGroups/acctestRG-cosmos-230627141318137548/providers/Microsoft.DocumentDB/databaseAccounts/acctest-ca2-230627141318137548

{
    "identity": {
        "type": "None"
    },
    "kind": "MongoDB",
    "location": "westeurope",
    "properties": {
        "consistencyPolicy": {
            "defaultConsistencyLevel": "Session",
            "maxStalenessPrefix": 100,
            "maxIntervalInSeconds": 5
        },
        "locations": [
            {
                "failoverPriority": 0,
                "isZoneRedundant": false,
                "locationName": "westeurope"
            }
        ],
        "databaseAccountOfferType": "Standard",
        "ipRules": [],
        "isVirtualNetworkFilterEnabled": false,
        "enableAutomaticFailover": false,
        "capabilities": [
            {
                "name": "EnableMongo"
            }
        ],
        "virtualNetworkRules": [],
        "enableMultipleWriteLocations": false,
        "disableKeyBasedMetadataWriteAccess": false,
        "defaultIdentity": "FirstPartyIdentity",
        "publicNetworkAccess": "Enabled",
        "enableFreeTier": false,
        "enableAnalyticalStorage": false,
        "createMode": "Restore",
        "backupPolicy": {
            "type": "Continuous"
        },
        "networkAclBypass": "None",
        "networkAclBypassResourceIds": [],
        "disableLocalAuth": false,
        "restoreParameters": {
            "restoreMode": "PointInTime",
            "restoreSource": "/subscriptions/xx-xx-xx-xx/providers/Microsoft.DocumentDB/locations/westeurope/restorableDatabaseAccounts/xx-xx-xx-xx",
            "restoreTimestampInUtc": "2023-06-27T06:38:13Z",
            "databasesToRestore": [
                {
                    "databaseName": "acctest-mongodb-230627141318137548",
                    "collectionNames": [
                        "acctest-mongodb-coll-230627141318137548"
                    ]
                }
            ]
        }
    },
    "tags": {}
}

API Response for the restored CosmosDB Account:

GET https://management.azure.com/subscriptions/xx-xx-xx-xx/resourceGroups/acctestRG-cosmos-230627141318137548/providers/Microsoft.DocumentDB/databaseAccounts/acctest-ca2-230627141318137548?api-version=2023-04-15

{
  "id": "/subscriptions/xx-xx-xx-xx/resourceGroups/acctestRG-cosmos-230627141318137548/providers/Microsoft.DocumentDB/databaseAccounts/acctest-ca2-230627141318137548",
  "name": "acctest-ca2-230627141318137548",
  "location": "West Europe",
  "type": "Microsoft.DocumentDB/databaseAccounts",
  "kind": "MongoDB",
  "tags": {},
  "systemData": {
    "createdAt": "2023-06-27T06:53:04.4144866Z"
  },
  "properties": {
    "provisioningState": "Succeeded",
    "documentEndpoint": "https://acctest-ca2-230627141318137548.documents.azure.com:443/",
    "sqlEndpoint": "https://acctest-ca2-230627141318137548.documents.azure.com:443/",
    "mongoEndpoint": "https://acctest-ca2-230627141318137548.mongo.cosmos.azure.com:443/",
    "publicNetworkAccess": "Enabled",
    "enableAutomaticFailover": false,
    "enableMultipleWriteLocations": false,
    "enablePartitionKeyMonitor": false,
    "isVirtualNetworkFilterEnabled": false,
    "virtualNetworkRules": [],
    "EnabledApiTypes": "MongoDB",
    "disableKeyBasedMetadataWriteAccess": false,
    "enableFreeTier": false,
    "enableAnalyticalStorage": false,
    "analyticalStorageConfiguration": {},
    "instanceId": "xx-xx-xx-xx",
    "createMode": "Restore",
    "databaseAccountOfferType": "Standard",
    "defaultIdentity": "FirstPartyIdentity",
    "networkAclBypass": "None",
    "disableLocalAuth": false,
    "enablePartitionMerge": false,
    "minimalTlsVersion": "Tls",
    "consistencyPolicy": {
      "defaultConsistencyLevel": "Eventual",
      "maxIntervalInSeconds": 5,
      "maxStalenessPrefix": 100
    },
    "apiProperties": {
      "serverVersion": "3.6"
    },
    "configurationOverrides": {
      "EnableBsonSchema": "True"
    },
    "writeLocations": [
      {
        "id": "acctest-ca2-230627141318137548-westeurope",
        "locationName": "West Europe",
        "documentEndpoint": "https://acctest-ca2-230627141318137548-westeurope.documents.azure.com:443/",
        "provisioningState": "Succeeded",
        "failoverPriority": 0,
        "isZoneRedundant": false
      }
    ],
    "readLocations": [
      {
        "id": "acctest-ca2-230627141318137548-westeurope",
        "locationName": "West Europe",
        "documentEndpoint": "https://acctest-ca2-230627141318137548-westeurope.documents.azure.com:443/",
        "provisioningState": "Succeeded",
        "failoverPriority": 0,
        "isZoneRedundant": false
      }
    ],
    "locations": [
      {
        "id": "acctest-ca2-230627141318137548-westeurope",
        "locationName": "West Europe",
        "documentEndpoint": "https://acctest-ca2-230627141318137548-westeurope.documents.azure.com:443/",
        "provisioningState": "Succeeded",
        "failoverPriority": 0,
        "isZoneRedundant": false
      }
    ],
    "failoverPolicies": [
      {
        "id": "acctest-ca2-230627141318137548-westeurope",
        "locationName": "West Europe",
        "failoverPriority": 0
      }
    ],
    "cors": [],
    "capabilities": [
      {
        "name": "EnableMongo"
      }
    ],
    "ipRules": [],
    "backupPolicy": {
      "type": "Continuous",
      "continuousModeProperties": {
        "tier": "Continuous30Days"
      }
    },
    "restoreParameters": {
      "restoreMode": "PointInTime",
      "restoreSource": "/subscriptions/xx-xx-xx-xx/providers/Microsoft.DocumentDB/locations/westeurope/restorableDatabaseAccounts/xx-xx-xx-xx",
      "restoreTimestampInUtc": "2023-06-27T06:38:13Z",
      "sourceBackupLocation": "West Europe",
      "databasesToRestore": [
        {
          "databaseName": "acctest-mongodb-230627141318137548",
          "collectionNames": [
            "acctest-mongodb-coll-230627141318137548"
          ]
        }
      ]
    },
    "networkAclBypassResourceIds": [],
    "capacity": {
      "totalThroughputLimit": -1
    },
    "keysMetadata": {
      "primaryMasterKey": {
        "generationTime": "xxxx"
      },
      "secondaryMasterKey": {
        "generationTime": "xxxx"
      },
      "primaryReadonlyMasterKey": {
        "generationTime": "xxxx"
      },
      "secondaryReadonlyMasterKey": {
        "generationTime": "xxxx"
      }
    }
  },
  "identity": {
    "type": "None"
  }
}
@ghost ghost added the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Jun 27, 2023
@JackTn JackTn added Cosmos Service Attention Workflow: This issue is responsible by Azure service team. labels Jun 27, 2023
@ghost ghost removed the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Jun 27, 2023
@ghost
Copy link

ghost commented Jun 27, 2023

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @pjohari-ms, @MehaKaushik, @zfoster, @kushagraThapar, @simorenoh, @simplynaveen20, @abinav2307.

Issue Details

Recently, we found that the defaultConsistencyLevel property isn't set to the value defined in request payload while creating the restored CosmosDB Account. This issue happens around 2023-05-19. Previously it works fine with same repro steps,which means the defaultConsistencyLevel property is able to be set to the value defined in request payload while creating the restored CosmosDB Account. So I assume it's a regression issue. Could you take a look/fix this issue asap? Thanks in advance.

Repro steps:

  1. Create the source CosmosDB Account with below "Request Payload 1".
  2. Create the restored CosmosDB Account based on above source CosmosDB Account with below "Request Payload 2".
  3. Invoke CosmosDB.Account.GET API to get the resource. You will find the defaultConsistencyLevel property isn't set to the value defined in below "Request Payload 2".

Request Payload 1 - Create source CosmosDB Account:

PUT https://management.azure.com/subscriptions/xx-xx-xx-xx/resourceGroups/acctestRG-cosmos-230627141318137548/providers/Microsoft.DocumentDB/databaseAccounts/acctest-ca-230627141318137548

{
    "identity": {
        "type": "None"
    },
    "kind": "MongoDB",
    "location": "westeurope",
    "properties": {
        "consistencyPolicy": {
            "defaultConsistencyLevel": "Eventual",
            "maxStalenessPrefix": 100,
            "maxIntervalInSeconds": 5
        },
        "locations": [
            {
                "failoverPriority": 0,
                "isZoneRedundant": false,
                "locationName": "westeurope"
            }
        ],
        "databaseAccountOfferType": "Standard",
        "ipRules": [],
        "isVirtualNetworkFilterEnabled": false,
        "enableAutomaticFailover": false,
        "capabilities": [
            {
                "name": "EnableMongo"
            }
        ],
        "virtualNetworkRules": [],
        "enableMultipleWriteLocations": false,
        "disableKeyBasedMetadataWriteAccess": false,
        "defaultIdentity": "FirstPartyIdentity",
        "publicNetworkAccess": "Enabled",
        "enableFreeTier": false,
        "enableAnalyticalStorage": false,
        "backupPolicy": {
            "type": "Continuous"
        },
        "networkAclBypass": "None",
        "networkAclBypassResourceIds": [],
        "disableLocalAuth": false
    },
    "tags": {}
}

Request Payload 2 - Create the restored CosmosDB Account based on above source CosmosDB Account:

PUT https://management.azure.com/subscriptions/xx-xx-xx-xx/resourceGroups/acctestRG-cosmos-230627141318137548/providers/Microsoft.DocumentDB/databaseAccounts/acctest-ca2-230627141318137548

{
    "identity": {
        "type": "None"
    },
    "kind": "MongoDB",
    "location": "westeurope",
    "properties": {
        "consistencyPolicy": {
            "defaultConsistencyLevel": "Session",
            "maxStalenessPrefix": 100,
            "maxIntervalInSeconds": 5
        },
        "locations": [
            {
                "failoverPriority": 0,
                "isZoneRedundant": false,
                "locationName": "westeurope"
            }
        ],
        "databaseAccountOfferType": "Standard",
        "ipRules": [],
        "isVirtualNetworkFilterEnabled": false,
        "enableAutomaticFailover": false,
        "capabilities": [
            {
                "name": "EnableMongo"
            }
        ],
        "virtualNetworkRules": [],
        "enableMultipleWriteLocations": false,
        "disableKeyBasedMetadataWriteAccess": false,
        "defaultIdentity": "FirstPartyIdentity",
        "publicNetworkAccess": "Enabled",
        "enableFreeTier": false,
        "enableAnalyticalStorage": false,
        "createMode": "Restore",
        "backupPolicy": {
            "type": "Continuous"
        },
        "networkAclBypass": "None",
        "networkAclBypassResourceIds": [],
        "disableLocalAuth": false,
        "restoreParameters": {
            "restoreMode": "PointInTime",
            "restoreSource": "/subscriptions/xx-xx-xx-xx/providers/Microsoft.DocumentDB/locations/westeurope/restorableDatabaseAccounts/xx-xx-xx-xx",
            "restoreTimestampInUtc": "2023-06-27T06:38:13Z",
            "databasesToRestore": [
                {
                    "databaseName": "acctest-mongodb-230627141318137548",
                    "collectionNames": [
                        "acctest-mongodb-coll-230627141318137548"
                    ]
                }
            ]
        }
    },
    "tags": {}
}

API Response for the restored CosmosDB Account:

GET https://management.azure.com/subscriptions/xx-xx-xx-xx/resourceGroups/acctestRG-cosmos-230627141318137548/providers/Microsoft.DocumentDB/databaseAccounts/acctest-ca2-230627141318137548?api-version=2023-04-15

{
  "id": "/subscriptions/xx-xx-xx-xx/resourceGroups/acctestRG-cosmos-230627141318137548/providers/Microsoft.DocumentDB/databaseAccounts/acctest-ca2-230627141318137548",
  "name": "acctest-ca2-230627141318137548",
  "location": "West Europe",
  "type": "Microsoft.DocumentDB/databaseAccounts",
  "kind": "MongoDB",
  "tags": {},
  "systemData": {
    "createdAt": "2023-06-27T06:53:04.4144866Z"
  },
  "properties": {
    "provisioningState": "Succeeded",
    "documentEndpoint": "https://acctest-ca2-230627141318137548.documents.azure.com:443/",
    "sqlEndpoint": "https://acctest-ca2-230627141318137548.documents.azure.com:443/",
    "mongoEndpoint": "https://acctest-ca2-230627141318137548.mongo.cosmos.azure.com:443/",
    "publicNetworkAccess": "Enabled",
    "enableAutomaticFailover": false,
    "enableMultipleWriteLocations": false,
    "enablePartitionKeyMonitor": false,
    "isVirtualNetworkFilterEnabled": false,
    "virtualNetworkRules": [],
    "EnabledApiTypes": "MongoDB",
    "disableKeyBasedMetadataWriteAccess": false,
    "enableFreeTier": false,
    "enableAnalyticalStorage": false,
    "analyticalStorageConfiguration": {},
    "instanceId": "xx-xx-xx-xx",
    "createMode": "Restore",
    "databaseAccountOfferType": "Standard",
    "defaultIdentity": "FirstPartyIdentity",
    "networkAclBypass": "None",
    "disableLocalAuth": false,
    "enablePartitionMerge": false,
    "minimalTlsVersion": "Tls",
    "consistencyPolicy": {
      "defaultConsistencyLevel": "Eventual",
      "maxIntervalInSeconds": 5,
      "maxStalenessPrefix": 100
    },
    "apiProperties": {
      "serverVersion": "3.6"
    },
    "configurationOverrides": {
      "EnableBsonSchema": "True"
    },
    "writeLocations": [
      {
        "id": "acctest-ca2-230627141318137548-westeurope",
        "locationName": "West Europe",
        "documentEndpoint": "https://acctest-ca2-230627141318137548-westeurope.documents.azure.com:443/",
        "provisioningState": "Succeeded",
        "failoverPriority": 0,
        "isZoneRedundant": false
      }
    ],
    "readLocations": [
      {
        "id": "acctest-ca2-230627141318137548-westeurope",
        "locationName": "West Europe",
        "documentEndpoint": "https://acctest-ca2-230627141318137548-westeurope.documents.azure.com:443/",
        "provisioningState": "Succeeded",
        "failoverPriority": 0,
        "isZoneRedundant": false
      }
    ],
    "locations": [
      {
        "id": "acctest-ca2-230627141318137548-westeurope",
        "locationName": "West Europe",
        "documentEndpoint": "https://acctest-ca2-230627141318137548-westeurope.documents.azure.com:443/",
        "provisioningState": "Succeeded",
        "failoverPriority": 0,
        "isZoneRedundant": false
      }
    ],
    "failoverPolicies": [
      {
        "id": "acctest-ca2-230627141318137548-westeurope",
        "locationName": "West Europe",
        "failoverPriority": 0
      }
    ],
    "cors": [],
    "capabilities": [
      {
        "name": "EnableMongo"
      }
    ],
    "ipRules": [],
    "backupPolicy": {
      "type": "Continuous",
      "continuousModeProperties": {
        "tier": "Continuous30Days"
      }
    },
    "restoreParameters": {
      "restoreMode": "PointInTime",
      "restoreSource": "/subscriptions/xx-xx-xx-xx/providers/Microsoft.DocumentDB/locations/westeurope/restorableDatabaseAccounts/xx-xx-xx-xx",
      "restoreTimestampInUtc": "2023-06-27T06:38:13Z",
      "sourceBackupLocation": "West Europe",
      "databasesToRestore": [
        {
          "databaseName": "acctest-mongodb-230627141318137548",
          "collectionNames": [
            "acctest-mongodb-coll-230627141318137548"
          ]
        }
      ]
    },
    "networkAclBypassResourceIds": [],
    "capacity": {
      "totalThroughputLimit": -1
    },
    "keysMetadata": {
      "primaryMasterKey": {
        "generationTime": "xxxx"
      },
      "secondaryMasterKey": {
        "generationTime": "xxxx"
      },
      "primaryReadonlyMasterKey": {
        "generationTime": "xxxx"
      },
      "secondaryReadonlyMasterKey": {
        "generationTime": "xxxx"
      }
    }
  },
  "identity": {
    "type": "None"
  }
}
Author: neil-yechenwei
Assignees: -
Labels:

Cosmos, Service Attention, needs-triage

Milestone: -

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Cosmos Service Attention Workflow: This issue is responsible by Azure service team.
Projects
None yet
Development

No branches or pull requests

2 participants