Skip to content

Bug for list_peers #498

Description

@linyxy

Hi devs,

My team owns a proudct that uses braft. We recently discovered a bug in the butil::Status list_peers(std::vector<PeerId>* peers); in node.

The implementation of list_peers function returns the result _conf.conf.list_peers, while we believe it should reutrn _conf.list_peers.

// node.cpp
butil::Status NodeImpl::list_peers(std::vector<PeerId>* peers) {
    BAIDU_SCOPED_LOCK(_mutex);
    if (_state != STATE_LEADER) {
        return butil::Status(EPERM, "Not leader");
    }
    _conf.conf.list_peers(peers);
    return butil::Status::OK();
}

During a reconfiguration, the current api would only return peers from new configuration instead of both old+new configuration. Since our product depends on this api for making decisions on cluster management, this bug limits our ability to safely doing reconfigurations and adds a lot of overhead to manage our cluster.

Looking forward to hearing back soon.
Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions