Archived
This forum has been archived. Please start a new discussion on GitHub.
strange behavior for ordered replica groups
I have a replica group containing 2 servers. This replica group is set to ordered, and 1 of the server has the priority 0, the other one having the priority 1.
Now, I tried to connect with 2 different clients to the replicated servers at the same time. I would like them both to connect to the first server having the priority 0. But after many time I tried, the behavior seems to be random. Some time both connect to the server priority 0, sometime each client connect to a different server, and sometime, they even both connect to the server having priority 1.
It is strange because I followed the instruction in the documentation + example, and I have set my proxy for the client as following: Ice::ObjectPrx proxy = m_ic->stringToProxy("toto");
proxy = proxy->ice_endpointSelection(Ice::Ordered);
How can I ensure that both client will always connect to the server having priority 0? I only want them to connect to server 1 in case the server 0 is crashed.
Now, I tried to connect with 2 different clients to the replicated servers at the same time. I would like them both to connect to the first server having the priority 0. But after many time I tried, the behavior seems to be random. Some time both connect to the server priority 0, sometime each client connect to a different server, and sometime, they even both connect to the server having priority 1.
It is strange because I followed the instruction in the documentation + example, and I have set my proxy for the client as following: Ice::ObjectPrx proxy = m_ic->stringToProxy("toto");
proxy = proxy->ice_endpointSelection(Ice::Ordered);
How can I ensure that both client will always connect to the server having priority 0? I only want them to connect to server 1 in case the server 0 is crashed.
0
Comments
-
Hi Vivien,
Could you post the XML descriptor showing the configuration of the replica group?
The only reason I can think of for this behavior is if the locator returns endpoints for multiple replicas (i.e.: you have set "n-replicas" to a value > 1 in the replica group configuration) and you already have a connection to the replica with the priority 1 established in your client. If you have set n-replicas to a value > 1, can you try setting it to 1?
Also, you could enable locator tracing in your client (with Ice.Trace.Location=2) and the registry (with IceGrid.Registry.Trace.Locator=2) to see if this gives you some clues.
Cheers,
Benoit.0 -
Thanks for the fast answer. And as always you spotted the right thing
"n-replicas" was set to 2 in the replica group configuration.
I have set it to 1 and retried everything. Now everything works perfectly!0