Re: Row pattern recognition

From: jian he <jian(dot)universality(at)gmail(dot)com>
To: Tatsuo Ishii <ishii(at)postgresql(dot)org>
Cc: assam258(at)gmail(dot)com, zsolt(dot)parragi(at)percona(dot)com, sjjang112233(at)gmail(dot)com, vik(at)postgresfriends(dot)org, er(at)xs4all(dot)nl, jacob(dot)champion(at)enterprisedb(dot)com, david(dot)g(dot)johnston(at)gmail(dot)com, peter(at)eisentraut(dot)org, li(dot)evan(dot)chao(at)gmail(dot)com, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Row pattern recognition
Date: 2026-08-25 03:33:52
Message-ID: CACJufxF8JPw_7uNN8Eb9p-E-BivAk_ZLXReRWM7arVqrhPT=nQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Aug 21, 2026 at 10:40 AM Tatsuo Ishii <ishii(at)postgresql(dot)org> wrote:
>
> Hi Jian,
>
> >
> > Summary: The code flow in update_reduced_frame, advance_reduced_frame_nfa, and
> > get_reduced_frame_status is now much more intuitive. Using elog(ERROR) prevents
> > us from getting stuck in an infinite loop if something goes wrong.
>
> For me, it's not clear why you add elog(ERROR), rather than Assert. If
> the infinite loop should not happen when our program is correct, it
> would be better to fix the problem and use Assert.
>

Assert will be optimized out in released builds.
Using elog(ERROR) can catch such unlikely errors in release builds.

Given how recursive the whole patchset is, even with 100% test coverage, I think
it would still be better to use elog(ERROR) to guard against some code
paths that should not be reached.

I also intend to add below at the beginning of nfa_state_free
``````
/* state at the free-list head was freed by the previous call */
if (unlikely(winstate->nfaStateFree == state))
elog(ERROR, "double free of RPR NFA state");
``````

--
jian
https://www.enterprisedb.com/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message surya poondla 2026-08-25 04:20:46 Re: pg_xmin_horizon: a system view of everything pinning the xmin horizon
Previous Message Hayato Kuroda (Fujitsu) 2026-08-25 02:12:01 RE: apply worker misses closing partition leaves