aws-containers / eks-app-mesh-polyglot-demo

End to end deployment and observability of polyglot microservices in Amazon EKS using AWS App Mesh, AWS Fargate, Amazon Cloudwatch Container Insights, and AWS X-Ray
MIT No Attribution
63 stars 618 forks source link

StatefulSet using AWS EBS - Deploy StatefulSet - mysql-0 and mysql-1 are not in sync #8

Open reagaros opened 2 years ago

reagaros commented 2 years ago

StatefulSet using AWS EBS - Deploy StatefulSet - mysql-0 and mysql-1 are not in sync.

This is for mysql-1 which has the table with data

 kubectl -n workshop run mysql-client --image=mysql:5.7 -it --rm --restart=Never --  mysql -h mysql-1.mysql -e "SELECT * FROM dev.product"                                                             
+--------+---------------+
| prodId | prodName      |
+--------+---------------+
| 999    | Mountain Bike |
| 1      | blog-db       |
+--------+---------------+

This is for mysql-0 which does not have either the table or the data, it is also unclear which one is leader and which one is follower.

kubectl -n workshop run mysql-client --image=mysql:5.7 -it --rm --restart=Never --  mysql -h mysql-0.mysql -e "SELECT * FROM dev.product"                                                             
ERROR 1146 (42S02) at line 1: Table 'dev.product' doesn't exist

The additional replicas if scaled has the synced data.

praseedasathaye commented 2 years ago

I am not able to reproduce this issue. I get the info everytime.

TeamRole:~/environment/eks-app-mesh-polyglot-demo (master) $ kubectl -n workshop run mysql-client --image=mysql:5.7 -it --rm --restart=Never --\
>   mysql -h mysql-read -e "SELECT * FROM dev.product"
+--------+---------------+
| prodId | prodName      |
+--------+---------------+
| 999    | Mountain Bike |
| 1000   | Road Bike     |
+--------+---------------+
pod "mysql-client" deleted
TeamRole:~/environment/eks-app-mesh-polyglot-demo (master) $ kubectl -n workshop run mysql-client --image=mysql:5.7 -it --rm --restart=Never --\
>   mysql -h mysql-read -e "SELECT * FROM dev.product"
+--------+---------------+
| prodId | prodName      |
+--------+---------------+
| 999    | Mountain Bike |
| 1000   | Road Bike     |
+--------+---------------+
pod "mysql-client" deleted
TeamRole:~/environment/eks-app-mesh-polyglot-demo (master) $ kubectl -n workshop run mysql-client --image=mysql:5.7 -it --rm --restart=Never --  mysql -h mysql-read -e "SELECT * FROM dev.product"
+--------+---------------+
| prodId | prodName      |
+--------+---------------+
| 999    | Mountain Bike |
| 1000   | Road Bike     |
+--------+---------------+
pod "mysql-client" deleted
TeamRole:~/environment/eks-app-mesh-polyglot-demo (master) $ kubectl -n workshop run mysql-client --image=mysql:5.7 -it --rm --restart=Never --  mysql -h mysql-read -e "SELECT * FROM dev.product"
+--------+---------------+
| prodId | prodName      |
+--------+---------------+
| 999    | Mountain Bike |
| 1000   | Road Bike     |
+--------+---------------+
pod "mysql-client" deleted
TeamRole:~/environment/eks-app-mesh-polyglot-demo (master) $