Bugfix and improvements in multixact.c

From: Maxim Orlov <orlovmg(at)gmail(dot)com>
To: Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Bugfix and improvements in multixact.c
Date: 2024-06-14 13:56:44
Message-ID: CACG=ezbLUG-OD1osAW3OchOMxZtdxHh2itYR9Zhh-a13wEBEQw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi!

While working on a making multix xact offsets 64-bit [0] I've discovered a
minor issue. The
thing is that type 'xid' is used in all macro, but it doesn't correct.
Appropriate MultiXactId or
MultiXactOffset should be used, actually.

And the second thing, as Heikki Linnakangas points out, args naming is also
misleading.

Since, these problems are not the point of thread [0], I decided to create
this discussion.
And here is the patch set addressing mentioned issues (0001 and 0002).

Additionally, I made an optional patch 0003 to switch from macro to inline
functions. For
me, personally, use of macro functions is justified if we are dealing with
different argument
types, to make polymorphic call. Which is not the case here. So, we can
have more
control over types and still generate the same code in terms of speed.
See https://godbolt.org/z/KM8voadhs Starting from O1 function is inlined,
thus no
overhead is noticeable. Anyway, it's up to the actual commiter to decide
does it worth it
or not. Again, this particular patch 0003 is completely optional.

As always, any opinions and reviews are very welcome!

[0]
https://www.postgresql.org/message-id/flat/ff143b24-a093-40da-9833-d36b83726bdf%40iki.fi#61d5a0e1cf6ab94b0e8aae8559bc4cf7

--
Best regards,
Maxim Orlov.

Attachment Content-Type Size
v1-0003-Switch-from-macro-functions-to-inline-in-multixac.patch application/octet-stream 4.1 KB
v1-0002-Fix-using-of-MultiXactOffset-type-insted-of-Trans.patch application/octet-stream 2.1 KB
v1-0001-Get-rid-of-misleading-xid-arg-name-in-multixact.patch application/octet-stream 3.6 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David E. Wheeler 2024-06-14 13:59:45 Re: jsonpath: Missing Binary Execution Path?
Previous Message Michail Nikolaev 2024-06-14 13:30:55 Re: Issues with ON CONFLICT UPDATE and REINDEX CONCURRENTLY