As per the documentation in the reference.conf, the "read-datacenter" configuration if added would typically allow reads from the local region but that not happening in the older and recent version of the cassandra extension library
Cosmos Cassandra account is configured with 4 regions
Code Execution
Based on the above configuration, we are expecting the reads to happen from the "West US" region for the following cassandra operation
What we noticed in the server side diagnostics was that the Execute operation happened in the "South India" region, following snap for reference.
When we perform the Query operation then also the same thing is observed, following snaps for reference
Check the region, it is "South India" instead of "West US"
Preferred region configuration
If we perform the test now with the preferred region configuration, the first region is treated as the local or preferred region and the code get executed in that specific region.
As per the following configuration, the "West US" is the read-datacenter location and "Southeast Asia" is the first region in the preferred locations configuration.
When we execute the Query operation, it gets executed in "Southeast Asia" region instead of "West US" region
Need help/clarity
Why the read-datacenter property which means read from local region is not working as expected
The preferred region configuration based on my understanding talking to few folks and the blog would be applicable during failover scenarios, so why is the first region treated as the local read region
As per the documentation in the reference.conf, the "read-datacenter" configuration if added would typically allow reads from the local region but that not happening in the older and recent version of the cassandra extension library
Application configuration
Library
Extension related configuration in the code
Cosmos Cassandra account is configured with 4 regions
Code Execution
Based on the above configuration, we are expecting the reads to happen from the "West US" region for the following cassandra operation
What we noticed in the server side diagnostics was that the Execute operation happened in the "South India" region, following snap for reference.
When we perform the Query operation then also the same thing is observed, following snaps for reference
Check the region, it is "South India" instead of "West US"
Preferred region configuration
If we perform the test now with the preferred region configuration, the first region is treated as the local or preferred region and the code get executed in that specific region.
As per the following configuration, the "West US" is the read-datacenter location and "Southeast Asia" is the first region in the preferred locations configuration.
When we execute the Query operation, it gets executed in "Southeast Asia" region instead of "West US" region
Need help/clarity