Skip to contentSkip to conversation

Changes in libccs behaviour (PLEASE READ!)

Cluster-devel Fabio M. Di Nitto 2 participants 3 messages Jun 3, 2008 – Jun 10, 2008

lore
Share & tools
lore
#0 lore raw

Hi guys,

I just landed the last bits in libccs to support both xpath lite and full xpath queries. With this new code, a couple of things need to be checked across all applications using libccs.

Relevant changes:

ccs_connect() used to return only when cluster is quorated. This is not the case anymore. ccs_connect will return as soon as it can connect to aisexec and init properly (or fail).
You can use cman_is_quorate from libcman for the same feature.

ccs_force_connect() used to take a cluster name in input. The API is still the same, but the cluster name is now ignored (it wasn't in used before either).

in order to use xpath lite or full xpath, set fullxpath (int from ccs.h) to either 0 (xpath lite and default) or 1 (full xpath) before invoking ccs_connect or ccs_force_connect.
In order to switch from one mode to another, you have to disconnect and connect again.

WARNING: use full xpath only if you cannot live without. It is slow and it's a memory eating piece of code.

WARNING2: the library is not thread safe (yet?). So far none of our callers really need this feature. Please let me know if i overlooked.

Please review your ccs init calls around and take appropriate actions.

ccs_test(8): not fully completed yet (another email will follow).

Feel free to contact me if you have any questions

Fabio

PS hint: ccs_force_connect() has a blocking option that will idle loop as long as required and will exit the loop when cman is available for queries. This could replace several hand made loops on ccs_connect i have seen around.

--
I'm going to make him an offer he can't refuse.

#1 lore raw
Quoted 6 lines · Fabio M. Di Nitto

Hi guys,

I just landed the last bits in libccs to support both xpath lite and full xpath queries. With this new code, a couple of things need to be checked across all applications using libccs.

Quoted 6 lines

Relevant changes:

ccs_connect() used to return only when cluster is quorated. This is not the case anymore. ccs_connect will return as soon as it can connect to aisexec and init properly (or fail).
You can use cman_is_quorate from libcman for the same feature.

This is good - one of the things we've had happen in the past is the "Not quorate/refusing connection" messages reported thousands of times.

I guess admins didn't like it :D

-- Lon

#2 lore raw
Quoted 14 lines · Lon Hohberger
Quoted 6 lines · Fabio M. Di Nitto

Hi guys,

I just landed the last bits in libccs to support both xpath lite and full xpath queries. With this new code, a couple of things need to be checked across all applications using libccs.

Quoted 6 lines

Relevant changes:

ccs_connect() used to return only when cluster is quorated. This is not the case anymore. ccs_connect will return as soon as it can connect to aisexec and init properly (or fail).
You can use cman_is_quorate from libcman for the same feature.

Quoted 4 lines

This is good - one of the things we've had happen in the past is the "Not quorate/refusing connection" messages reported thousands of times.

I guess admins didn't like it :D

The reason why I did remove the quorum check is because i don't believe it belongs there. Note that this also removes the guarantee that the configuration you are reading is from a quorated cluster.

It is an important bit that should not be understimated.

In order to make sure of what you are reading, you want to have a positive answer from cman_is_quorate and then ccs_connect/get.

The good side is that ccs_connect now connects to cman/aisexec objdb. It virtually removes the problem of thinking in terms of connecting to 2 different daemons.

Fabio

--
I'm going to make him an offer he can't refuse.