@@ -2273,14 +2273,14 @@ MtmBuildConnectivityMatrix(nodemask_t* matrix)
2273
2273
}
2274
2274
2275
2275
2276
- static int MtmGetNumberOfVotingNodes ()
2276
+ static int MtmGetNumberOfVotingNodes (nodemask_t clique )
2277
2277
{
2278
2278
int i ;
2279
2279
int nVotingNodes = Mtm -> nAllNodes ;
2280
- notebask_t deadNodeMask = Mtm -> deadNodeMask ;
2280
+ nodemask_t deadNodeMask = Mtm -> deadNodeMask ;
2281
2281
for (i = 0 ; deadNodeMask != 0 ; i ++ ) {
2282
2282
if (BIT_CHECK (deadNodeMask , i )) {
2283
- if (!BIT_CHECK (newClique , i )) {
2283
+ if (!BIT_CHECK (clique , i )) {
2284
2284
nVotingNodes -= 1 ;
2285
2285
}
2286
2286
BIT_CLEAR (deadNodeMask , i );
@@ -2299,7 +2299,7 @@ void MtmRefreshClusterStatus()
2299
2299
nodemask_t matrix [MAX_NODES ];
2300
2300
int cliqueSize ;
2301
2301
nodemask_t oldClique = ~Mtm -> disabledNodeMask & (((nodemask_t )1 << Mtm -> nAllNodes )- 1 );
2302
- int nVotingNodes ;
2302
+ int i , nVotingNodes ;
2303
2303
2304
2304
MtmBuildConnectivityMatrix (matrix );
2305
2305
newClique = MtmFindMaxClique (matrix , Mtm -> nAllNodes , & cliqueSize );
@@ -2320,7 +2320,7 @@ void MtmRefreshClusterStatus()
2320
2320
newClique = MtmFindMaxClique (matrix , Mtm -> nAllNodes , & cliqueSize );
2321
2321
} while (newClique != oldClique );
2322
2322
2323
- nVotingNodes = MtmGetNumberOfVotingNodes ();
2323
+ nVotingNodes = MtmGetNumberOfVotingNodes (newClique );
2324
2324
if (cliqueSize >= nVotingNodes /2 + 1 || (cliqueSize == (nVotingNodes + 1 )/2 && MtmMajorNode )) { /* have quorum */
2325
2325
fprintf (stderr , "Old mask: " );
2326
2326
for (i = 0 ; i < Mtm -> nAllNodes ; i ++ ) {
@@ -2385,7 +2385,8 @@ void MtmRefreshClusterStatus()
2385
2385
*/
2386
2386
void MtmCheckQuorum (void )
2387
2387
{
2388
- int nVotingNodes = MtmGetNumberOfVotingNodes ();
2388
+ nodemask_t oldClique = ~Mtm -> disabledNodeMask & (((nodemask_t )1 << Mtm -> nAllNodes )- 1 );
2389
+ int nVotingNodes = MtmGetNumberOfVotingNodes (oldClique );
2389
2390
2390
2391
if (Mtm -> nLiveNodes >= nVotingNodes /2 + 1 || (Mtm -> nLiveNodes == (nVotingNodes + 1 )/2 && MtmMajorNode )) { /* have quorum */
2391
2392
if (Mtm -> status == MTM_IN_MINORITY ) {
@@ -4383,8 +4384,8 @@ Datum mtm_make_table_local(PG_FUNCTION_ARGS)
4383
4384
rv = makeRangeVar (MULTIMASTER_SCHEMA_NAME , MULTIMASTER_LOCAL_TABLES_TABLE , -1 );
4384
4385
rel = heap_openrv (rv , RowExclusiveLock );
4385
4386
if (rel != NULL ) {
4386
- char * tableName = RelationGetRelationName ( rel );
4387
- Oid schemaid = RelationGetNamespace ( rel );
4387
+ char * tableName = get_rel_name ( reloid );
4388
+ Oid schemaid = get_rel_namespace ( reloid );
4388
4389
char * schemaName = get_namespace_name (schemaid );
4389
4390
4390
4391
tupDesc = RelationGetDescr (rel );
0 commit comments