提交 8d2a56a4 编写于 作者: S Shoaib Lari 提交者: C.J. Jameson

gpstop: Recognize downed segments before exiting

Run a distributed query across all segments to force FTS to detect and mark all
downed segments.

Author: Nadeem Ghani <nghani@pivotal.io>
Author: Marbin Tan <mtan@pivotal.io>
Author: Shoaib Lari <slari@pivotal.io>
Author: C.J. Jameson <cjameson@pivotal.io>
上级 4f96c774
......@@ -32,6 +32,7 @@ try:
from gppylib.gp_era import GpEraFile
from gppylib.operations.unix import CleanSharedMem
from gppylib.operations.utils import ParallelOperation, RemoteOperation
from gppylib.operations.rebalanceSegments import ReconfigDetectionSQLQueryCommand
except ImportError, e:
sys.exit('ERROR: Cannot import modules. Please check that you have sourced greenplum_path.sh. Detail: ' + str(e))
......@@ -183,6 +184,22 @@ class GpStop:
self.cleanup()
signal.signal(signal.SIGINT, signal.default_int_handler)
if self.onlyThisHost:
logger.info("Recognizing new cluster state...")
try:
# currently responsible for triggering an update to gp_segment_configuration
# because dbconn.connect() internally calls commit()
self.conn = dbconn.connect(self.dburl)
# backup in case connect() does not do a commit
ReconfigDetectionSQLQueryCommand(self.conn).run()
except Exception as e:
logger.debug('query trying to start a transaction failed: %s' % str(e))
logger.debug('expected: the purpose was that by attempting a transaction, gp_segment_configuration would be updated')
finally:
if self.conn:
self.conn.close()
if self.restart:
logger.info("Restarting System...")
gp.NewGpStart.local('restarting system', verbose=logging_is_verbose(),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册