From 4dc25ad70c4901facf27fa9f5cfaa2a66835e51d Mon Sep 17 00:00:00 2001 From: Abhijit Subramanya Date: Wed, 28 Oct 2020 15:39:50 -0700 Subject: [PATCH] Harden analyzedb against concurrently dropped and recreated tables Commit 4bbbb3810eb043af521dd60e738aaa2538cf30d4 introduced some hardening around concurrent drop and recreate of tables while analyzedb is running but it failed to take into account the code around updating the last operation performed. This commit fixes it. --- gpMgmt/bin/analyzedb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gpMgmt/bin/analyzedb b/gpMgmt/bin/analyzedb index a5425e82b9..7994a1189b 100755 --- a/gpMgmt/bin/analyzedb +++ b/gpMgmt/bin/analyzedb @@ -695,8 +695,9 @@ class AnalyzeDb(Operation): prev_ao_state_dict[schema_table] = new_modcount # update last op for tables that are successfully analyzed - last_op_info = curr_last_op_dict[schema_table] # {'CREATE':'', 'ALTER':'', ...} - prev_last_op_dict[schema_table] = last_op_info + if schema_table in curr_last_op_dict: + last_op_info = curr_last_op_dict[schema_table] # {'CREATE':'', 'ALTER':'', ...} + prev_last_op_dict[schema_table] = last_op_info # update column dict if is_full or schema_table in dirty_partitions or schema_table not in prev_col_dict or '-1' in \ -- GitLab