From: Michael P. <mic...@gm...> - 2012-04-05 04:51:37
|
On Thu, Apr 5, 2012 at 2:09 AM, Tejeswar Mupparti <tej...@ho...>wrote: > Hi, > > I have a quick question on a GTM behavior > > We are a starting a new initiative and exploring PG-XC for our > Cloud-database. I installed a 2 node PG-XC cluster and in one of the > scenario I did a kill -9 on one of the data node and later restarted it, > but it failed to join the cluster(repeatedly) with this message > > FATAL: Can not register Datanode on GTM > > When I looked at the GTM code, the routine pgxcnode_add_info() is trying > to add the datanode into the global table and finds a duplicate and rejects > the registration, this is obvious since the datanode wasn't a clean > shutdown. Is this considered a bug or an expected behavior? > As cited, this is expected behavior, we cannot take the risk to have a not registering once again in cluster once it has been shutdown abruptly. > > pgxcnode_add_info > Recovery_PGXCNodeRegister > ProcessPGXCNodeRegister > ProcessPGXCNodeCommand (argp=0x10c8ca8) at main.cpp:1421 > > In general for a cluster system we will have membership layer, heartbeat > check is performed and datanode death might have been detected and a > cleanup is done for global hash table. > > BTW I have worked around the problem by calling Unregister just before > calling pgxcnode_add_info(). Can you please share your ideas and thoughts. > There are currently no direct way to reallow a node to register with the same node name in cluster for the time being. You need to erase the registration information written on disk by GTM and then restart your cluster. But here are some thoughts about that. 1) We could add an option in postgres binary to block node registration when node is up. Something like: postgres --block-register 2) We could add a GUC parameter in postgresql.conf, simply an on/off switch, that controls if the node needs to register in case it recovers from a crash. Those are just some ideas of course, but option 2 looks more flexible. Regards, -- Michael Paquier http://michael.otacoo.com |