Question regarding heap_multi_insert documentation

Started by Daniel Gustafssonover 6 years ago4 messageshackers
Jump to latest
#1Daniel Gustafsson
daniel@yesql.se

While reading the code for heapam.c:heap_multi_insert I happened upon this
comment which I'm either too thick for, or it lacks a word or two:

* ..
* A check here does not definitively prevent a serialization anomaly;
* that check MUST be done at least past the point of acquiring an
* exclusive buffer content lock on every buffer that will be affected,
* and MAY be done after all inserts are reflected in the buffers and
* those locks are released; otherwise there race condition. Since
* multiple buffers can be locked and unlocked in the loop below, and it
* would not be feasible to identify and lock all of those buffers before
* the loop, we must do a final check at the end.
* ..

The part I don't understand is "otherwise there race condition", it doesn't
sound complete to me as a non-native english speaker. Should that really be
"otherwise there *is a (potential)* race condition" or something similar?

cheers ./daniel

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Daniel Gustafsson (#1)
Re: Question regarding heap_multi_insert documentation

Daniel Gustafsson <daniel@yesql.se> writes:

The part I don't understand is "otherwise there race condition", it doesn't
sound complete to me as a non-native english speaker. Should that really be
"otherwise there *is a (potential)* race condition" or something similar?

I agree, it's missing "is a".

regards, tom lane

#3Daniel Gustafsson
daniel@yesql.se
In reply to: Tom Lane (#2)
Re: Question regarding heap_multi_insert documentation

On 13 Jan 2020, at 00:25, Tom Lane <tgl@sss.pgh.pa.us> wrote:

Daniel Gustafsson <daniel@yesql.se> writes:

The part I don't understand is "otherwise there race condition", it doesn't
sound complete to me as a non-native english speaker. Should that really be
"otherwise there *is a (potential)* race condition" or something similar?

I agree, it's missing "is a".

Thanks for clarifying. PFA tiny patch for this.

cheers ./daniel

Attachments:

multiinsert_comment.diffapplication/octet-stream; name=multiinsert_comment.diff; x-unix-mode=0644Download+1-1
#4Michael Paquier
michael@paquier.xyz
In reply to: Daniel Gustafsson (#3)
Re: Question regarding heap_multi_insert documentation

On Mon, Jan 13, 2020 at 12:40:20AM +0100, Daniel Gustafsson wrote:

Thanks for clarifying. PFA tiny patch for this.

Thanks, pushed.
--
Michael