FZambia/go-sentinel

queryForSlaves() does not filter out the unavailable slaves

yudecheng opened this issue · 4 comments

If one of the slaves stops, the query results of command “SENTINEL slaves master_name“ will also contain the stopped slave. We can filter out these unavailable slaves according to the “flags” field.
The “flags” of the unavailable slave contains "disconnected" or "s_down".
s1
s2

I am sorry that close this issue by mistake.

@yudecheng thanks for your report and suggested fix, I'll come up with backwards compatible pull request very soon.

@yudecheng please look at #3 - is it ok? I think it's pretty reasonable approach which we can extend in future.