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: ClusterSlaves result should be cut #884

Merged
merged 1 commit into from
Apr 20, 2024

Conversation

drivebyer
Copy link
Collaborator

Description
ClusterSlaves get slave info, we should parse it to get slave node id.
截屏2024-04-20 14 49 45

otherwise, the error log:

{"level":"error","ts":"2024-04-20T14:50:06+08:00","logger":"controllers.RedisCluster","msg":"Could not execute command","Command":["redis-cli","--cluster","del-node","redis-cluster-v1beta2-leader-0.redis-cluster-v1beta2-leader-headless.default.svc:6379","3acb029fead40752f432c84f9bed2e639119a573 192.168.84.239:6379@16379,redis-cluster-v1beta2-follower-5 slave e3299968586dd457a8dba04fc6c747cecd38510f 0 1713595736542 6 connected"],"Output":">>> Removing node 3acb029fead40752f432c84f9bed2e639119a573 192.168.84.239:6379@16379,redis-cluster-v1beta2-follower-5 slave e3299968586dd457a8dba04fc6c747cecd38510f 0 1713595736542 6 connected from cluster redis-cluster-v1beta2-leader-0.redis-cluster-v1beta2-leader-headless.default.svc:6379\n[ERR] No such node ID 3acb029fead40752f432c84f9bed2e639119a573 192.168.84.239:6379@16379,redis-cluster-v1beta2-follower-5 slave e3299968586dd457a8dba04fc6c747cecd38510f 0 1713595736542 6 connected\n","error":"execute command with error: command terminated with exit code 1, stderr: ","stacktrace":"github.com/OT-CONTAINER-KIT/redis-operator/k8sutils.executeCommand\n\t/Users/wuyang/workspace/github.com/drivebyer/redis-operator-1/k8sutils/redis.go:402\ngithub.com/OT-CONTAINER-KIT/redis-operator/k8sutils.RemoveRedisFollowerNodesFromCluster\n\t/Users/wuyang/workspace/github.com/drivebyer/redis-operator-1/k8sutils/cluster-scaling.go:312\ngithub.com/OT-CONTAINER-KIT/redis-operator/controllers.(*RedisClusterReconciler).Reconcile\n\t/Users/wuyang/workspace/github.com/drivebyer/redis-operator-1/controllers/rediscluster_controller.go:95\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Reconcile\n\t/Users/wuyang/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.17.2/pkg/internal/controller/controller.go:119\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler\n\t/Users/wuyang/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.17.2/pkg/internal/controller/controller.go:316\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n\t/Users/wuyang/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.17.2/pkg/internal/controller/controller.go:266\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2\n\t/Users/wuyang/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.17.2/pkg/internal/controller/controller.go:227"}

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • Tests have been added/modified and all tests pass.
  • Functionality/bugs have been confirmed to be unchanged or fixed.
  • I have performed a self-review of my own code.

Additional Context

Signed-off-by: drivebyer <yang.wu@daocloud.io>
@drivebyer drivebyer added the bug Something isn't working label Apr 20, 2024
@drivebyer drivebyer requested a review from shubham-cmyk April 20, 2024 07:40
Copy link

codecov bot commented Apr 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 39.51%. Comparing base (d121d86) to head (5b1c3f7).
Report is 28 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #884      +/-   ##
==========================================
+ Coverage   35.20%   39.51%   +4.31%     
==========================================
  Files          19       19              
  Lines        3213     2660     -553     
==========================================
- Hits         1131     1051      -80     
+ Misses       2015     1540     -475     
- Partials       67       69       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@drivebyer drivebyer enabled auto-merge (squash) April 20, 2024 08:34
@drivebyer drivebyer merged commit 7999a05 into OT-CONTAINER-KIT:master Apr 20, 2024
29 checks passed
@drivebyer drivebyer deleted the fix-get-slaves-id branch April 26, 2024 09:14
mattrobinsonsre pushed a commit to mattrobinsonsre/redis-operator that referenced this pull request Jul 11, 2024
Signed-off-by: drivebyer <yang.wu@daocloud.io>
Signed-off-by: Matt Robinson <mattrobinsonsre@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants