Question regarding heap_multi_insert documentation

From: Daniel Gustafsson <daniel(at)yesql(dot)se>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Question regarding heap_multi_insert documentation
Date: 2020-01-12 23:03:37
Message-ID: FED18699-4270-4778-8DA8-10F119A5ECF3@yesql.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2020-01-12 23:25:29 Re: Question regarding heap_multi_insert documentation
Previous Message Joe Nelson 2020-01-12 21:43:38 Re: refactoring - standardize integer parsing in front-end utilities