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

Fix a bug when vm hosting master mongodb is down #80

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Apr 11, 2018

  1. Fix a bug when vm hosting master mongodb is down

    Pod mongodb-0 (master) was on node master1. After master1 was shut down, mongodb-0's STATUS was in "Unknown", whereas pod.status.phase was "Running". mongodb-0 is repetitively selected as the cluster's master and removed from cluster as it is not reachable. It inhibited other cluster members to become a master. Sidecar needs to check correct field for pod status.
    ----logs---
    kube@xinsfang-worker-1:~$ kubectl logs -n=maglev-system mongodb-2 -c mongo-sidecar
    ...
     Pod has been elected as a secondary to do primary work
     Addresses to add:     [ 'mongodb-0.mongodb.maglev-system.svc.cluster.local:27017' ]
    ...
    
    kube@xinsfang-worker-1:~$ kubectl get po mongodb-0 -n=maglev-system
    NAME        READY     STATUS    RESTARTS   AGE
    mongodb-0   3/3       Unknown   0          20h
    kube@xinsfang-worker-1:~$ kubectl get po mongodb-0 -n=maglev-system -oyaml | grep phase
      phase: Running
    xinsfang authored Apr 11, 2018
    Configuration menu
    Copy the full SHA
    b2ee468 View commit details
    Browse the repository at this point in the history