Re: Extensible Rmgr for Table AMs
Andres Freund <andres@anarazel.de>
From: Andres Freund <andres@anarazel.de>
To: Jeff Davis <pgsql@j-davis.com>, Heikki Linnakangas <heikki.linnakangas@iki.fi>
Cc: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>, Julien Rouhaud <rjuju123@gmail.com>, Robert Haas <robertmhaas@gmail.com>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>, Amit Kapila <amit.kapila16@gmail.com>, Tom Lane <tgl@sss.pgh.pa.us>, Simon Riggs <simon@2ndquadrant.com>
Date: 2022-04-07T06:35:05Z
Lists: pgsql-hackers
Hi,
On 2022-04-06 23:15:27 -0700, Jeff Davis wrote:
> I'm happy with this patch and I committed it.
That caused breakage with WAL_DEBUG enabled. Fixed that. But it was
half-broken before, at least since 70e81861fad, because 'rmid' didn't refer to
the current record's rmid anymore, but to rmid from "Initialize resource
managers" - a constant.
Causes plenty new warnings here:
In file included from /home/andres/src/postgresql/src/include/access/xlogrecord.h:14,
from /home/andres/src/postgresql/src/include/access/xlogreader.h:41,
from /home/andres/src/postgresql/src/include/access/brin_xlog.h:17,
from /home/andres/src/postgresql/src/backend/access/transam/rmgr.c:10:
/home/andres/src/postgresql/src/backend/access/transam/rmgr.c: In function ‘RegisterCustomRmgr’:
/home/andres/src/postgresql/src/include/access/rmgr.h:42:66: warning: comparison is always true due to limited range of data type [-Wtype-limits]
42 | (rmid) <= RM_MAX_CUSTOM_ID)
| ^~
/home/andres/src/postgresql/src/backend/access/transam/rmgr.c:104:14: note: in expansion of macro ‘RMID_IS_CUSTOM’
104 | if (!RMID_IS_CUSTOM(rmid))
| ^~~~~~~~~~~~~~
In file included from /home/andres/src/postgresql/src/include/c.h:814,
from /home/andres/src/postgresql/src/include/postgres.h:46,
from /home/andres/src/postgresql/src/bin/pg_waldump/rmgrdesc.c:9:
/home/andres/src/postgresql/src/bin/pg_waldump/rmgrdesc.c: In function ‘GetRmgrDesc’:
/home/andres/src/postgresql/src/include/access/rmgr.h:42:66: warning: comparison is always true due to limited range of data type [-Wtype-limits]
42 | (rmid) <= RM_MAX_CUSTOM_ID)
| ^~
/home/andres/src/postgresql/src/bin/pg_waldump/rmgrdesc.c:89:9: note: in expansion of macro ‘Assert’
89 | Assert(RMID_IS_VALID(rmid));
| ^~~~~~
/home/andres/src/postgresql/src/include/access/rmgr.h:43:57: note: in expansion of macro ‘RMID_IS_CUSTOM’
43 | #define RMID_IS_VALID(rmid) (RMID_IS_BUILTIN((rmid)) || RMID_IS_CUSTOM((rmid)))
| ^~~~~~~~~~~~~~
/home/andres/src/postgresql/src/bin/pg_waldump/rmgrdesc.c:89:16: note: in expansion of macro ‘RMID_IS_VALID’
89 | Assert(RMID_IS_VALID(rmid));
| ^~~~~~~~~~~~~
/home/andres/src/postgresql/src/include/access/rmgr.h:42:66: warning: comparison is always true due to limited range of data type [-Wtype-limits]
42 | (rmid) <= RM_MAX_CUSTOM_ID)
| ^~
/home/andres/src/postgresql/src/bin/pg_waldump/rmgrdesc.c:89:9: note: in expansion of macro ‘Assert’
89 | Assert(RMID_IS_VALID(rmid));
| ^~~~~~
/home/andres/src/postgresql/src/include/access/rmgr.h:43:57: note: in expansion of macro ‘RMID_IS_CUSTOM’
43 | #define RMID_IS_VALID(rmid) (RMID_IS_BUILTIN((rmid)) || RMID_IS_CUSTOM((rmid)))
| ^~~~~~~~~~~~~~
/home/andres/src/postgresql/src/bin/pg_waldump/rmgrdesc.c:89:16: note: in expansion of macro ‘RMID_IS_VALID’
89 | Assert(RMID_IS_VALID(rmid));
| ^~~~~~~~~~~~~
Greetings,
Andres Freund
Commits
-
Fix off-by-one error in pg_waldump, introduced in 5c279a6d350.
- dad97e0502b4 15.0 landed
-
Fix another buildfarm issue from commit 5c279a6d350.
- 957aa4d87a41 15.0 landed
-
Fix warning introduced in 5c279a6d350.
- 9553b4115f18 15.0 landed
-
Custom WAL Resource Managers.
- 5c279a6d3502 15.0 landed
-
Make logical decoding a part of the rmgr.
- 7a5f6b47488d 15.0 landed