forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit0f928a8
committed
Fix possible cache invalidation failure in ReceiveSharedInvalidMessages.
Commitfad153e modified sinval.c to reducethe number of calls into sinvaladt.c (which require taking a shared lock)by keeping a local buffer of collected-but-not-yet-processed messages.However, if processing of the last message in a batch resulted in arecursive call to ReceiveSharedInvalidMessages, we could overwrite thatmessage with a new one while the outer invalidation function was stillworking on it. This would be likely to lead to invalidation of the wrongcache entry, allowing subsequent processing to use stale cache data.The fix is just to make a local copy of each message while we're processingit.Spotted by Andres Freund. Back-patch to 8.4 where the bug was introduced.1 parent3727afa commit0f928a8
1 file changed
+4
-4
lines changedLines changed: 4 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
91 | 91 |
| |
92 | 92 |
| |
93 | 93 |
| |
94 |
| - | |
| 94 | + | |
95 | 95 |
| |
96 | 96 |
| |
97 |
| - | |
| 97 | + | |
98 | 98 |
| |
99 | 99 |
| |
100 | 100 |
| |
| |||
121 | 121 |
| |
122 | 122 |
| |
123 | 123 |
| |
124 |
| - | |
| 124 | + | |
125 | 125 |
| |
126 | 126 |
| |
127 |
| - | |
| 127 | + | |
128 | 128 |
| |
129 | 129 |
| |
130 | 130 |
| |
|
0 commit comments
Comments
(0)