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

replica can not restart automatically #80

Closed
overstep123 opened this issue Aug 23, 2021 · 2 comments · Fixed by #82
Closed

replica can not restart automatically #80

overstep123 opened this issue Aug 23, 2021 · 2 comments · Fixed by #82

Comments

@overstep123
Copy link

The issue tracker is ONLY used for the bug report(feature request need to follow RIP process). Keep in mind, please check whether there is an existing same report before you raise a new one.

I use example/rocketmq_v1alpha1_rocketmq_cluster.yaml to startup a rocketMQ cluster. But the replica pod can not restart automatically. The error in the broker.log is
image

. The subscriptionGroup.json and subscriptionGroup.json.bak are both have the same content "". And I found that is because the replica pod execute the command 'echo "" > subscriptionGroup.json'.
image

BUG REPORT

  1. Please describe the issue you observed:
  • What did you do (The steps to reproduce)?
    Use the operator to startup a rocketMQ cluster(the size is 2),and kill one replica pod.

  • What did you expect to see?
    The replica pod is restarting again and again.

  • What did you see instead?
    The replica pod can startup successfully

  1. Please tell us about your environment:
    operator version: the latest master branch.
    kubernetes version: v1.19.10
@caigy
Copy link
Contributor

caigy commented Aug 24, 2021

The problem can be reproduced by following steps:

  1. Start a RocketMQ cluster with 2 brokers;
  2. When no subscription exists, that is, the file /root/store/config/subscriptionGroup.json in broker-0-master-0 does NOT exists, increase the size of cluster;
  3. The added brokers will failed to start because /root/store/config/subscriptionGroup.json contains <nil>, which is an invalid JSON string.

Cause:
When the actual size of cluster is less than the specified number, the broker controller will create new brokers, and copy subscriptionGroup.json in broker-0-master-0 to the added brokers. However, if that file does not exists, controller/broker.exec just returns a string "", which is copied to the added brokers.

@caigy
Copy link
Contributor

caigy commented Aug 24, 2021

@overstep123 Would you submit a PR to fix it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants