Turn TransactionIdRetreat/Advance into inline functions

Started by Maxim Orlovover 3 years ago4 messageshackers
Jump to latest
#1Maxim Orlov
orlovmg@gmail.com

Hi!

This patch is inspired by [0]/messages/by-id/5b558da8-99fb-0a99-83dd-f72f05388517@enterprisedb.com and many others.
I've notice recent activity to convert macros into inline functions. We
should make TransactionIdRetreat/Advance functions
Instead of a macro, should we?

I also think about NormalTransactionIdPrecedes and
NormalTransactionIdFollows, but maybe, they should be addressed
separately: the comment says that "this is a macro for speed".

Any thoughts?

[0]: /messages/by-id/5b558da8-99fb-0a99-83dd-f72f05388517@enterprisedb.com
/messages/by-id/5b558da8-99fb-0a99-83dd-f72f05388517@enterprisedb.com

--
Best regards,
Maxim Orlov.

Attachments:

v1-0001-Convert-macros-to-static-inline-functions-transam.patchapplication/octet-stream; name=v1-0001-Convert-macros-to-static-inline-functions-transam.patchDownload+33-28
#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Maxim Orlov (#1)
Re: Turn TransactionIdRetreat/Advance into inline functions

Maxim Orlov <orlovmg@gmail.com> writes:

I've notice recent activity to convert macros into inline functions. We
should make TransactionIdRetreat/Advance functions
Instead of a macro, should we?

-1. Having to touch all the call sites like this outweighs
any claimed advantage: it makes them uglier and it will greatly
complicate any back-patching we might have to do in those areas.

regards, tom lane

#3Maxim Orlov
orlovmg@gmail.com
In reply to: Tom Lane (#2)
Re: Turn TransactionIdRetreat/Advance into inline functions

-1. Having to touch all the call sites like this outweighs
any claimed advantage: it makes them uglier and it will greatly
complicate any back-patching we might have to do in those areas.

regards, tom lane

Ok, got it. But what if we change the semantics of these calls to
xid = TransactionIdAdvance(xid) ?

--
Best regards,
Maxim Orlov.

#4Tom Lane
tgl@sss.pgh.pa.us
In reply to: Maxim Orlov (#3)
Re: Turn TransactionIdRetreat/Advance into inline functions

Maxim Orlov <orlovmg@gmail.com> writes:

-1. Having to touch all the call sites like this outweighs
any claimed advantage: it makes them uglier and it will greatly
complicate any back-patching we might have to do in those areas.

Ok, got it. But what if we change the semantics of these calls to
xid = TransactionIdAdvance(xid) ?

Uh ... you'd still have to touch all the call sites.

regards, tom lane