Fix primary crash continually with invalid checkpoint after promote

2022-04-27 Thread Zhao Rui
Newly promoted primary may leave an invalid checkpoint. In function CreateRestartPoint, control file is updated and old wals are removed. But in some situations, control file is not updated, old wals are still removed. Thus produces an invalid checkpoint with nonexistent wal. Crucial log: "inva

Re:Improving RLS planning

2022-07-07 Thread Zhao Rui
This causes wrong index scan with RLS. Maybe function restriction_is_securely_promotable is too strict? You can reproduce in this way: create table abc (a integer, b text); insert into abc select (random()*(10^4))::integer, (random()*(10^4))::text from generate_series(1,10); create index

Re:Improving RLS planning

2022-07-07 Thread Zhao Rui
This patch causes wrong index scan plan with RLS. Maybe function restriction_is_securely_promotable is too strict? You can reproduce in this way: create table abc (a integer, b text); insert into abc select (random()*(10^4))::integer, (random()*(10^4))::text from generate_series(1,10); c