提交 22884d45 编写于 作者: M Marbin Tan 提交者: Marbin Tan

Fix gpexpand misreporting re-distributed table.

When gpexpand is run with a specific duration or end-time using '-d' or
'-e' flag, there might be an off-chance that gpexpand reports that the
re-distribute was successful, however, that's not the case.
gpexpand status details reports as COMPLETED, but the data has not been
redistributed and is still distributed by RANDOM.
Signed-off-by: NNadeem Ghani <nghani@pivotal.io>
Signed-off-by: NTushar Dadlani <tdadlani@pivotal.io>
上级 5e9753b7
......@@ -2240,10 +2240,10 @@ UPDATE gp_distribution_policy
while not self.queue.isDone():
logger.debug(
"woke up. queue: %d finished %d " % (self.queue.num_assigned, self.queue.completed_queue.qsize()))
time.sleep(5)
if stopTime and datetime.datetime.now() >= stopTime:
stoppedEarly = True
break
time.sleep(5)
expansionStopped = datetime.datetime.now()
......@@ -2552,6 +2552,11 @@ class ExpandTable():
dbconn.execSQL(table_conn, sql)
table_conn.commit()
return True
# I can only get here if the cancel flag is True
return False
def mark_finished(self, status_conn, start_time, finish_time):
sql = """UPDATE %s.%s
SET status = '%s', expansion_started='%s', expansion_finished='%s'
......@@ -2725,8 +2730,8 @@ class ExpandCommand(SQLCommand):
if not options.simple_progress:
self.table.mark_started(status_conn, table_conn, start_time, self.cancel_flag)
self.table.expand(table_conn, self.cancel_flag)
table_exp_success = True
table_exp_success = self.table.expand(table_conn, self.cancel_flag)
except Exception, ex:
if ex.__str__().find('canceling statement due to user request') == -1 and not self.cancel_flag:
table_expand_error = True
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册