Skip to content

Commit 3812831

Browse files
author
Oleg Ivanov
committed
Must fix the bug with replication
1 parent 010f274 commit 3812831

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

contrib/aqo/preprocessing.c

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,21 @@ aqo_planner(Query *parse,
163163
aqo_mode);
164164
break;
165165
}
166+
if (RecoveryInProgress())
167+
{
168+
if (aqo_mode == AQO_MODE_FORCED)
169+
{
170+
adding_query = false;
171+
learn_aqo = false;
172+
auto_tuning = false;
173+
collect_stat = false;
174+
}
175+
else
176+
{
177+
disable_aqo_for_query();
178+
return call_default_planner(parse, cursorOptions, boundParams);
179+
}
180+
}
166181
if (adding_query)
167182
{
168183
add_query(query_hash, learn_aqo, use_aqo, fspace_hash, auto_tuning);
@@ -177,8 +192,14 @@ aqo_planner(Query *parse,
177192
fspace_hash = DatumGetInt32(query_params[3]);
178193
auto_tuning = DatumGetBool(query_params[4]);
179194
collect_stat = learn_aqo || use_aqo || auto_tuning;
180-
if (!collect_stat)
195+
if (!learn_aqo && !use_aqo && !auto_tuning)
181196
add_deactivated_query(query_hash);
197+
if (RecoveryInProgress())
198+
{
199+
learn_aqo = false;
200+
auto_tuning = false;
201+
collect_stat = false;
202+
}
182203
}
183204
explain_aqo = use_aqo;
184205

0 commit comments

Comments
 (0)