copy-past-o comment in lock.h

Started by John Nayloralmost 7 years ago7 messageshackers
Jump to latest
#1John Naylor
john.naylor@enterprisedb.com

Attached is an attempt to match surrounding code. More broadly,
though, it seems the "ID info" comments belong with the SET_LOCKTAG_*
macros rather than with the LockTagType enum members.

--
John Naylor https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Attachments:

locktag-comment.patchapplication/octet-stream; name=locktag-comment.patchDownload+2-2
#2Michael Paquier
michael@paquier.xyz
In reply to: John Naylor (#1)
Re: copy-past-o comment in lock.h

On Tue, May 07, 2019 at 03:41:50PM +0800, John Naylor wrote:

Attached is an attempt to match surrounding code. More broadly,
though, it seems the "ID info" comments belong with the SET_LOCKTAG_*
macros rather than with the LockTagType enum members.

+   LOCKTAG_SPECULATIVE_TOKEN,  /* for speculative insertion */
+   /* ID info for a speculative token is TRANSACTION info + token */
Shouldn't the first comment be just "speculative insertion"?  And the
second one "ID info for a speculative insertion is transaction ID +
its speculative insert counter"?
--
Michael
#3John Naylor
john.naylor@enterprisedb.com
In reply to: Michael Paquier (#2)
Re: copy-past-o comment in lock.h

On Tue, May 7, 2019 at 4:00 PM Michael Paquier <michael@paquier.xyz> wrote:

On Tue, May 07, 2019 at 03:41:50PM +0800, John Naylor wrote:

Attached is an attempt to match surrounding code. More broadly,
though, it seems the "ID info" comments belong with the SET_LOCKTAG_*
macros rather than with the LockTagType enum members.

+   LOCKTAG_SPECULATIVE_TOKEN,  /* for speculative insertion */
+   /* ID info for a speculative token is TRANSACTION info + token */
Shouldn't the first comment be just "speculative insertion"?

That's probably better.

And the
second one "ID info for a speculative insertion is transaction ID +
its speculative insert counter"?

I was just going by the variable name at hand, but more precision may be good.

--
John Naylor https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

#4Michael Paquier
michael@paquier.xyz
In reply to: John Naylor (#3)
Re: copy-past-o comment in lock.h

On Tue, May 07, 2019 at 04:12:31PM +0800, John Naylor wrote:

That's probably better.

Would you like to send an updated patch? Perhaps you have a better
idea?
--
Michael

#5John Naylor
john.naylor@enterprisedb.com
In reply to: Michael Paquier (#4)
Re: copy-past-o comment in lock.h

On Wed, May 8, 2019 at 3:10 PM Michael Paquier <michael@paquier.xyz> wrote:

On Tue, May 07, 2019 at 04:12:31PM +0800, John Naylor wrote:

That's probably better.

Would you like to send an updated patch? Perhaps you have a better
idea?
--
Michael

In the attached, I've used your language, and also moved the comments
closer to the code they are describing. That seems more logical and
future proof.

--
John Naylor https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Attachments:

locktag-comment-v2.patchapplication/octet-stream; name=locktag-comment-v2.patchDownload+18-14
#6Michael Paquier
michael@paquier.xyz
In reply to: John Naylor (#5)
Re: copy-past-o comment in lock.h

On Wed, May 08, 2019 at 03:59:36PM +0800, John Naylor wrote:

In the attached, I've used your language, and also moved the comments
closer to the code they are describing. That seems more logical and
future proof.

Good idea to move the comments so what you proposes looks fine to me.
Are there any objections?
--
Michael

#7Michael Paquier
michael@paquier.xyz
In reply to: Michael Paquier (#6)
Re: copy-past-o comment in lock.h

On Wed, May 08, 2019 at 05:03:31PM +0900, Michael Paquier wrote:

Good idea to move the comments so what you proposes looks fine to me.
Are there any objections?

Okay, committed.
--
Michael