question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

when kv cluster with pd,Client getClusterInfo api always return null....

See original GitHub issue

com.alipay.sofa.jraft.rhea.DefaultPlacementDriverService#handleGetClusterInfoRequest

   @Override
    public void handleGetClusterInfoRequest(final GetClusterInfoRequest request,
                                            final RequestProcessClosure<BaseRequest, BaseResponse> closure) {
        final long clusterId = request.getClusterId();
        final GetClusterInfoResponse response = new GetClusterInfoResponse();
        response.setClusterId(clusterId);
        if (!this.isLeader) {
            response.setError(Errors.NOT_LEADER);
            closure.sendResponse(response);
            return;
        }
        try {
            final Cluster cluster = this.metadataStore.getClusterInfo(clusterId);
            response.setCluster(cluster);
            response.setValue(cluster); //Client getValue to setCluster, and null
        } catch (final Throwable t) {
            LOG.error("Failed to handle: {}, {}.", request, StackTraceUtil.stackTrace(t));
            response.setError(Errors.forException(t));
        }
        closure.sendResponse(response);
    }

com.alipay.sofa.jraft.rhea.client.pd.DefaultPlacementDriverRpcService#internalCallPdWithRpc

private <V> void internalCallPdWithRpc(final Endpoint endpoint, final BaseRequest request,
                                           final FailoverClosure<V> closure) {
        final String address = endpoint.toString();
        final InvokeContext invokeCtx = ExtSerializerSupports.getInvokeContext();
        final InvokeCallback invokeCallback = new InvokeCallback() {

            @Override
            public void onResponse(final Object result) {
                final BaseResponse<?> response = (BaseResponse<?>) result;
                if (response.isSuccess()) {
                    closure.setData(response.getValue()); //TODO here here here
                    closure.run(Status.OK());
                } else {
                    closure.setError(response.getError());
                    closure.run(new Status(-1, "RPC failed with address: %s, response: %s", address, response));
                }
            }

            @Override
            public void onException(final Throwable t) {
                closure.failure(t);
            }

            @Override
            public Executor getExecutor() {
                return rpcCallbackExecutor;
            }
        };
        try {
            this.rpcClient.invokeWithCallback(address, request, invokeCtx, invokeCallback, this.rpcTimeoutMillis);
        } catch (final Throwable t) {
            closure.failure(t);
        }
    }

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
fengjiachuncommented, Feb 10, 2020

Please pay attention to my last reply, which has answered your question

In addition, you can run the following two test classes

com.alipay.sofa.jraft.rhea.PdServer com.alipay.sofa.jraft.rhea.pd.RheaHeartbeatTest

1reaction
juabycommented, Feb 10, 2020

PD Server: final Cluster cluster = this.metadataStore.getClusterInfo(clusterId); response.setCluster(cluster); //Client getValue to setCluster, and null

PD Client: response.getValue() == null closure.setData(response.getValue()); //TODO here here here closure.run(Status.OK());

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cluster name returns null #889 - kubernetes-client/java - GitHub
For some reason I'm getting a null cluster name when I retrieve pod via the client but seems to work from the CLI:...
Read more >
use concise character class syntax '\d' instead of '[^0-9 ...
Return type of .sort and IO::Spec::Unix.path is always Seq; Out-of-range .AT-POS on Range objects returns Nil; Pair.AT-KEY for non-existent key returns Nil
Read more >
11.2 - BMC Documentation
443, Basho Riak KV, RiakCluster, Command, /usr/sbin/riak-admin status | grep ring_members, To get cluster key and member hosts, UNIX, False, TKU_2015_07_01 ...
Read more >
https://patch-diff.githubusercontent.com/raw/apach...
getClusterInfo currently returns `ClusterSummary` instance +which has a ... + +client.blobstore.class: The blob store implementation the storm client uses.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found