Welcome to the new Gigaspaces XAP forum. To recover your account, please follow these instructions.

Ask Your Question

Pinging clustered proxy

When ping() is called for a clustered proxy, it returns successfully if at least one partition is available.

How could I identify a case when at least one partition is NOT available (neither it's primary nor backup)?

asked 2017-03-16 07:43:02 -0500

Alexey Serdyuk gravatar image
edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted

A distributed ping should be implemented. It should execute a Task using the ExecutorBuilder where a separate task should be executed against each partition. All the returned results should be aggregated reporting which partition responded and which one hasn't.


answered 2017-03-16 08:34:18 -0500

shay hassidim gravatar image
edit flag offensive delete link more

Hello Shay,

We have followed your advice and a distributed ping (based on DistributedTask) works in most cases. But there is a special case of a LocalView...

(1) What is a recommended way to detect when any partition behind the LocalView is not available (both primary and backup)? (2) What is a recommended way to distinguish a read-write space (such as a normal space) from a read-only space (such as a LocalView), when a GigaSpace instance object is available? The distinction may be important because one can't execute a Task or DistributedTask against a read-only space.

answered 2017-03-23 08:55:24 -0500

Alexey Serdyuk gravatar image
edit flag offensive delete link more


You should monitor the replication activity between the primary and local view. If the redo log grows or channel is disconnected you should raise an alert. When running backup , local view using replication mechanism.

See the API Example section: https://docs.gigaspaces.com/xap120adm...

To distinguish between a regular remote proxy and one with a local cache/view you can check the underlying implementation class for the GigaSpace.getSpace(). It should be a different class.

shay hassidim gravatar imageshay hassidim ( 2017-03-24 08:34:26 -0500 )edit

Thank you. I am testing now a bit different implementation. Could you please check if you see some hidden weak points in it?

(1) Get gigaSpace.getSpace().getDirectProxy() to get a direct connection to the underlying space for a local view.

(2) Use getSpaceClusterInfo() to get a number of active partitions.

(3) Use directSpaceProxy.getProxyRouter().getAllAvailableSpaces() to get all available space components (all partitions, primary and backup).

(4) For each space component check if it is active (primary) and if it is call ping() on it. Count a number of primary partitions which could be successfully pinged.

(5) If the number of active partitions which could be successfully pinged is the same as the total number of active partitions, consider that the space is healthy.

This approach appears to work for a single partition as well as for multiple partitions, and for a "real" remote space as well as for a LocalView. Still I would like to get your opinion on it.

Alexey Serdyuk gravatar imageAlexey Serdyuk ( 2017-03-24 08:49:49 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2017-03-16 07:43:02 -0500

Seen: 203 times

Last updated: Mar 23