提交 f82734c3 编写于 作者: J Jacob Champion

gpMgmt: remove changelogging/resync states from all utilities

Replace both concepts with MODE_NOT_SYNC -- WALrep doesn't make any
further distinction.
上级 1c9ac0a4
......@@ -19,7 +19,7 @@ try:
from gppylib.commands.unix import *
from gppylib.fault_injection import inject_fault
from gppylib.commands.gp import *
from gppylib.gparray import GpArray, MODE_CHANGELOGGING, STATUS_DOWN
from gppylib.gparray import GpArray, MODE_NOT_SYNC, STATUS_DOWN
from gppylib.gpparseopts import OptParser, OptChecker
from gppylib.gplog import *
from gppylib.db import catalog
......@@ -1323,12 +1323,12 @@ Set PGDATABASE or use the -D option to specify the correct database to use.""" %
self.gparray.dumpToFile(self.statusLogger.get_gp_segment_configuration_backup())
self.statusLogger.set_status('UPDATE_CATALOG_STARTED', self.statusLogger.get_gp_segment_configuration_backup())
# Put expansion segment primaries in change tracking
# Mark expansion segment primaries not in sync
for seg in self.gparray.getExpansionSegDbList():
if seg.isSegmentMirror() == True:
continue
if self.gparray.get_mirroring_enabled() == True:
seg.setSegmentMode(MODE_CHANGELOGGING)
seg.setSegmentMode(MODE_NOT_SYNC)
# Set expansion segment mirror state = down
for seg in self.gparray.getExpansionSegDbList():
......
......@@ -246,7 +246,7 @@ class GpMirrorListToBuild:
seg = toRecover.getFailoverSegment()
seg.setSegmentStatus(gparray.STATUS_DOWN) # down initially, we haven't started it yet
seg.setSegmentMode(gparray.MODE_RESYNCHRONIZATION)
seg.setSegmentMode(gparray.MODE_NOT_SYNC)
# figure out what needs to be started or transitioned
mirrorsToStart = []
......@@ -270,10 +270,9 @@ class GpMirrorListToBuild:
and seg.getSegmentRole() == gparray.ROLE_MIRROR:
rewindInfo.append((seg, primarySeg.getSegmentHostName(), primarySeg.getSegmentPort()))
# The change in configuration to of the mirror to down requires
# that the primary also be change to change tracking if required.
if primarySeg.getSegmentMode() != gparray.MODE_CHANGELOGGING:
primarySeg.setSegmentMode(gparray.MODE_CHANGELOGGING)
# The change in configuration to of the mirror to down requires that
# the primary also be marked as unsynchronized.
primarySeg.setSegmentMode(gparray.MODE_NOT_SYNC)
primariesToConvert.append(primarySeg)
convertPrimaryUsingFullResync.append(toRecover.isFullSynchronization())
......
......@@ -100,7 +100,7 @@ class GpMirrorBuildCalculator:
preferred_role=gparray.ROLE_MIRROR,
dbid=self.__nextDbId,
role=gparray.ROLE_MIRROR,
mode=gparray.MODE_RESYNCHRONIZATION,
mode=gparray.MODE_NOT_SYNC,
status=gparray.STATUS_UP,
hostname=targetHost,
address=address,
......@@ -109,7 +109,7 @@ class GpMirrorBuildCalculator:
self.__gpArray.addSegmentDb(mirror)
primary.setSegmentMode(gparray.MODE_RESYNCHRONIZATION)
primary.setSegmentMode(gparray.MODE_NOT_SYNC)
resultOut.append(GpMirrorToBuild(None, primary, mirror, True))
......
......@@ -15,7 +15,7 @@ from datetime import datetime
from gppylib.commands.base import Command, ExecutionError, REMOTE
from gppylib.commands.gp import chk_local_db_running
from gppylib.db import dbconn
from gppylib.gparray import GpArray, MODE_SYNCHRONIZED, MODE_RESYNCHRONIZATION
from gppylib.gparray import GpArray, MODE_SYNCHRONIZED
from pygresql import pg
PARTITION_START_DATE = '2010-01-01'
......@@ -579,15 +579,6 @@ def are_segments_synchronized():
return True
def is_any_segment_resynchronized():
gparray = GpArray.initFromCatalog(dbconn.DbURL())
segments = gparray.getDbList()
for seg in segments:
if seg.mode == MODE_RESYNCHRONIZATION:
return True
return False
def check_row_count(context, tablename, dbname, nrows):
NUM_ROWS_QUERY = 'select count(*) from %s' % tablename
# We want to bubble up the exception so that if table does not exist, the test fails
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册