Re: Modernize error message for malformed B-Tree tuple posting
| От | Chao Li |
|---|---|
| Тема | Re: Modernize error message for malformed B-Tree tuple posting |
| Дата | |
| Msg-id | 0E7AC835-B654-4512-ACEB-1E8CB86722C3@gmail.com обсуждение исходный текст |
| Ответ на | Modernize error message for malformed B-Tree tuple posting (Kirill Reshke <reshkekirill@gmail.com>) |
| Список | pgsql-hackers |
> On Feb 18, 2026, at 15:58, Kirill Reshke <reshkekirill@gmail.com> wrote: > > Hi! > > Today, while routinely fixing corruptions reported by our monitoring, > I observed a message: > > 2026-02-15 01:38:33.060 > MSK,"<cut>","<cut>",1725745,"localhost:51330",6990f425.1a5531,1,"UPDATE",2026-02-15 > 01:16:05 MSK,59/1760774,183431134,ERROR,XX000,"posting list tuple with > 3 items cannot be split at offset 20",,,,,,"UPDATE .... <there was > origin query,cut>,,,"","client backend",,3082007398573165030 > > > So, two things are bothering me here. First, this is XX000 and not > XX002 which I cannot find a good reason to. Second, Index name is not > present in the error message. > > Another about-corruption error messages seems to be different, for example: > > ERROR,XX002,"table tid from new index tuple (58084,119) overlaps with > invalid duplicate tuple at offset 62 of block 181 in index ""<cut > name>""",,,,,,"UPDATE <cut query> > > So, v1 changes the errcode for ERR_INDEX_CORRUPTION. For including > index name, we need > to pass relation to _bt_swap_posting function, which I did not do in > v1, because I'm not sure changing is worth it. > > WDYT? > > -- > Best regards, > Kirill Reshke > <v1-0001-Modernize-error-message-for-malformed-B-Tree-tupl.patch> Hi Kirill, Thanks for the patch. It makes sense to me to replace elog with the more modern ereport() and to add a REINDEX hint. One small thing: the hint message "Please REINDEX it" feels a bit ambiguous to me. I initially thought it would be betterto include the index name in the hint, but then I noticed that _bt_swap_posting() doesn’t have access to the Relation,so it doesn’t know which index is affected. If passing a Relation rel parameter down to this function isn’t acceptable, then maybe we could at least rephrase the hintto something like: “You might need to REINDEX the index.”, which sounds a bit clearer and avoids the vague “it”. Best regards, -- Chao Li (Evan) HighGo Software Co., Ltd. https://www.highgo.com/
В списке pgsql-hackers по дате отправления: