mirror of
https://github.com/postgres/postgres.git
synced 2025-09-02 04:21:28 +03:00
Avoid deadlocks during insertion into SP-GiST indexes.
SP-GiST's original scheme for avoiding deadlocks during concurrent index insertions doesn't work, as per report from Hailong Li, and there isn't any evident way to make it work completely. We could possibly lock individual inner tuples instead of their whole pages, but preliminary experimentation suggests that the performance penalty would be huge. Instead, if we fail to get a buffer lock while descending the tree, just restart the tree descent altogether. We keep the old tuple positioning rules, though, in hopes of reducing the number of cases where this can happen. Teodor Sigaev, somewhat edited by Tom Lane
This commit is contained in:
@@ -652,7 +652,7 @@ extern void spgPageIndexMultiDelete(SpGistState *state, Page page,
|
||||
OffsetNumber *itemnos, int nitems,
|
||||
int firststate, int reststate,
|
||||
BlockNumber blkno, OffsetNumber offnum);
|
||||
extern void spgdoinsert(Relation index, SpGistState *state,
|
||||
extern bool spgdoinsert(Relation index, SpGistState *state,
|
||||
ItemPointer heapPtr, Datum datum, bool isnull);
|
||||
|
||||
#endif /* SPGIST_PRIVATE_H */
|
||||
|
Reference in New Issue
Block a user