.alter cluster policy query_weak_consistency command

Sets the cluster's query weak consistency policy, overriding the current policy, and then returns the updated policy. The updated policy can be later viewed using the show command. If not altered, the default policy applies.

Permissions

You must have AllDatabasesAdmin permissions to run this command.

Syntax

.alter cluster policy query_weak_consistency PolicyObject

.alter-merge cluster policy query_weak_consistency PolicyObject

Note

With .alter any property that isn't specified will be set to its default. With .alter-merge, only the properties that you specify will be modified while the rest remain unchanged.

Learn more about syntax conventions.

Parameters

Name Type Required Description
PolicyObject string ✔️ A serialized JSON policy object. For the policy properties, see the query weak consistency policy.

Returns

JSON serialization of the updated query weak consistency policy object

Examples

alter

alter command:

.alter cluster policy query_weak_consistency ```{
   "PercentageOfNodes": 10,
   "MinimumNumberOfNodes": 2,
   "MaximumNumberOfNodes": 20,
   "SuperSlackerNumberOfNodesThreshold": -1,
   "EnableMetadataPrefetch": false,
   "MaximumLagAllowedInMinutes": 10,
   "RefreshPeriodInSeconds": 300
   }```

Output

PolicyName EntityName Policy ChildEntities EntityType
QueryWeakConsistencyPolicy {"PercentageOfNodes": 10, "MinimumNumberOfNodes": 2, "MaximumNumberOfNodes": 20, "SuperSlackerNumberOfNodesThreshold": -1, "EnableMetadataPrefetch": false, "MaximumLagAllowedInMinutes": 10, "RefreshPeriodInSeconds": 300} Cluster

For demonstrating the alter-merge, we'll assume the following policy is set prior to executing the command:

{
  "PercentageOfNodes": 20,
  "MinimumNumberOfNodes": 10,
  "MaximumNumberOfNodes": 100, 
  "SuperSlackerNumberOfNodesThreshold": -1,
  "EnableMetadataPrefetch": false,
  "MaximumLagAllowedInMinutes": 5,
  "RefreshPeriodInSeconds": 30
}

alter-merge

alter-merge command:

.alter-merge cluster policy query_weak_consistency @'{"PercentageOfNodes": 30, "MaximumLagAllowedInMinutes": 15}'

Output

PolicyName EntityName Policy ChildEntities EntityType
QueryWeakConsistencyPolicy {"PercentageOfNodes": 30, "MinimumNumberOfNodes": 10, "MaximumNumberOfNodes": 100, "SuperSlackerNumberOfNodesThreshold": -1, "EnableMetadataPrefetch": false, "MaximumLagAllowedInMinutes": 15, "RefreshPeriodInSeconds": 30} Cluster

As can be seen, only PercentageOfNodes and MaximumLagAllowedInMinutes were modified (whereas if the alter command was used instead, the remaining properties would be also modified, and set to their defaults).