Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: Looks like we have a dummy comparison cmd here :P Issues found: kvstore kv-compare is the cmd to do the comparison between current nodes kvstore dict and its peer's kvstore dict. Let's say we have node1, nod2 and node3 and they are peers of each other. We try do compare kvstore copy of node1 with node2 and node3 to see if they are consistent. However, by utilizing the current `KvStoreClient` functionality, we are verifying node1's kvstore copy with its OWN. Reason is root caused due to the usage of `cli_opts` passed in to KvStoreClient. Although `zmq_endpoint` is passed in separately, it is NOT honored and used. KvStoreClient: ``` 21 class KvStoreClient(OpenrClientDeprecated): 22 def __init__(self, cli_opts, host=None): 23 host = host if host else cli_opts.host 24 zmq_endpoint = "tcp://[{}]:{}".format(host, cli_opts.kv_rep_port) 25 super(KvStoreClient, self).__init__( 26 OpenrModuleType.KVSTORE, zmq_endpoint, cli_opts 27 ) ``` OpenrClientDeprecated: ``` 153 def get_thrift_client(self, use_ssl): 154 socket = ( 155 TSSLSocket.TSSLSocket( 156 host=self.cli_opts.host, 157 port=self.cli_opts.openr_ctrl_port, 158 # verify server 159 cert_reqs=ssl.CERT_REQUIRED, 160 ca_certs=self.cli_opts.ca_file, 161 certfile=self.cli_opts.cert_file, 162 keyfile=self.cli_opts.key_file, 163 verify_name=self.cli_opts.acceptable_peer_name, 164 ) 165 if use_ssl 166 else TSocket.TSocket( 167 host=self.cli_opts.host, port=self.cli_opts.openr_ctrl_port 168 ) 169 ``` FIx: As part of the zmq->thrift migration, this OpenrClientDeprecated will no longer be used. By utilizing OpenrCtrlClient, host info is honored, which leads to the expected behavior of dumping kvstore dic of peer nodes. Reviewed By: saifhhasan, tonyqiu1019 Differential Revision: D15929012 fbshipit-source-id: 4afc7261ce11d0ae4281206604f3dd4256e8a1fd
- Loading branch information