In Redis (Cluster Mode Enabled) we use Configuration Endpoint for both read and write operations. so how redis determines which of the cluster's node to access means how it decide which role should pick master or slave .

Following below aws steps to connect with redis . After connecting with cluster some time it pick master role and sometime it pick slave role . whenever it pick slave role every operation (set and get ) stuck . Suppose if i will do get also it will show redirected to and stuck and will not go to prompt . But when it pick master it works properly .

https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/in-transit-encryption.html#connect-tls

So need assistance to understand how it pick role (master/slave) for configuration end point.