Re: Atomic GetFreeIndexPage()?

2022-05-04 Thread Peter Geoghegan
On Wed, May 4, 2022 at 12:16 PM Chris Cleveland wrote: > Similar code is repeated in a bunch of places. Each access method has to > explicitly write something into a freed page that identifies it as ok to use. I wouldn't say that that's what this code is doing, though I do see what you mean.

Re: Atomic GetFreeIndexPage()?

2022-05-04 Thread Tom Lane
Chris Cleveland writes: > Would it make sense to make GetFreeIndexPage() atomic? I strongly doubt it. The loss of concurrency would outweigh any code-simplicity benefits. regards, tom lane

Atomic GetFreeIndexPage()?

2022-05-04 Thread Chris Cleveland
Would it make sense to make GetFreeIndexPage() atomic? Internally, GetFreeIndexPage() calls GetPageWithFreeSpace() and then RecordUsedIndexPage() in two separate operations. It's possible for two different processes to get the same free page at the same time. To guard against this, there are