- Notifications
You must be signed in to change notification settings - Fork5
Commitdb18703
committed
Fix LISTEN/NOTIFY race condition reported by Gavin Sherry. While a
really general fix might be difficult, I believe the only case whereAtCommit_Notify could see an uncommitted tuple is where the other guyhas just unlistened and not yet committed. The best solution seems tobe to just skip updating that tuple, on the assumption that the otherguy does not want to hear about the notification anyway. This is notperfect --- if the other guy rolls back his unlisten instead of committing,then he really should have gotten this notify. But to do that, we'd haveto wait to see if he commits or not, or make UNLISTEN hold exclusive lockon pg_listener until commit. Either of these answers is deadlock-prone,not to mention horrible for interactive performance. Do it this wayfor now. (What happened to that project to do LISTEN/NOTIFY in memorywith no table, anyway?)1 parentd73e1b3 commitdb18703
File tree
4 files changed
+92
-19
lines changed- src
- backend
- access/heap
- commands
- executor
- include/access
4 files changed
+92
-19
lines changedLines changed: 29 additions & 9 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
8 | 8 |
| |
9 | 9 |
| |
10 | 10 |
| |
11 |
| - | |
| 11 | + | |
12 | 12 |
| |
13 | 13 |
| |
14 | 14 |
| |
| |||
1206 | 1206 |
| |
1207 | 1207 |
| |
1208 | 1208 |
| |
| 1209 | + | |
| 1210 | + | |
| 1211 | + | |
| 1212 | + | |
| 1213 | + | |
1209 | 1214 |
| |
1210 | 1215 |
| |
1211 | 1216 |
| |
1212 |
| - | |
| 1217 | + | |
1213 | 1218 |
| |
1214 | 1219 |
| |
1215 | 1220 |
| |
| |||
1243 | 1248 |
| |
1244 | 1249 |
| |
1245 | 1250 |
| |
1246 |
| - | |
| 1251 | + | |
1247 | 1252 |
| |
1248 | 1253 |
| |
1249 | 1254 |
| |
| |||
1275 | 1280 |
| |
1276 | 1281 |
| |
1277 | 1282 |
| |
1278 |
| - | |
| 1283 | + | |
| 1284 | + | |
| 1285 | + | |
1279 | 1286 |
| |
1280 | 1287 |
| |
1281 | 1288 |
| |
| |||
1369 | 1376 |
| |
1370 | 1377 |
| |
1371 | 1378 |
| |
1372 |
| - | |
| 1379 | + | |
| 1380 | + | |
| 1381 | + | |
| 1382 | + | |
1373 | 1383 |
| |
1374 | 1384 |
| |
1375 | 1385 |
| |
| |||
1396 | 1406 |
| |
1397 | 1407 |
| |
1398 | 1408 |
| |
| 1409 | + | |
| 1410 | + | |
| 1411 | + | |
| 1412 | + | |
| 1413 | + | |
1399 | 1414 |
| |
1400 | 1415 |
| |
1401 | 1416 |
| |
1402 |
| - | |
| 1417 | + | |
1403 | 1418 |
| |
1404 | 1419 |
| |
1405 | 1420 |
| |
| |||
1443 | 1458 |
| |
1444 | 1459 |
| |
1445 | 1460 |
| |
1446 |
| - | |
| 1461 | + | |
1447 | 1462 |
| |
1448 | 1463 |
| |
1449 | 1464 |
| |
| |||
1475 | 1490 |
| |
1476 | 1491 |
| |
1477 | 1492 |
| |
1478 |
| - | |
| 1493 | + | |
| 1494 | + | |
| 1495 | + | |
1479 | 1496 |
| |
1480 | 1497 |
| |
1481 | 1498 |
| |
| |||
1699 | 1716 |
| |
1700 | 1717 |
| |
1701 | 1718 |
| |
1702 |
| - | |
| 1719 | + | |
| 1720 | + | |
| 1721 | + | |
| 1722 | + | |
1703 | 1723 |
| |
1704 | 1724 |
| |
1705 | 1725 |
| |
|
Lines changed: 55 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
7 | 7 |
| |
8 | 8 |
| |
9 | 9 |
| |
10 |
| - | |
| 10 | + | |
11 | 11 |
| |
12 | 12 |
| |
13 | 13 |
| |
| |||
515 | 515 |
| |
516 | 516 |
| |
517 | 517 |
| |
| 518 | + | |
| 519 | + | |
| 520 | + | |
518 | 521 |
| |
519 | 522 |
| |
520 |
| - | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
521 | 551 |
| |
522 | 552 |
| |
523 |
| - | |
| 553 | + | |
524 | 554 |
| |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
525 | 570 |
| |
526 | 571 |
| |
527 | 572 |
| |
| |||
803 | 848 |
| |
804 | 849 |
| |
805 | 850 |
| |
806 |
| - | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
807 | 858 |
| |
808 | 859 |
| |
809 | 860 |
| |
|
Lines changed: 5 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
26 | 26 |
| |
27 | 27 |
| |
28 | 28 |
| |
29 |
| - | |
| 29 | + | |
30 | 30 |
| |
31 | 31 |
| |
32 | 32 |
| |
| |||
1406 | 1406 |
| |
1407 | 1407 |
| |
1408 | 1408 |
| |
1409 |
| - | |
| 1409 | + | |
| 1410 | + | |
1410 | 1411 |
| |
1411 | 1412 |
| |
1412 | 1413 |
| |
| |||
1540 | 1541 |
| |
1541 | 1542 |
| |
1542 | 1543 |
| |
1543 |
| - | |
| 1544 | + | |
| 1545 | + | |
1544 | 1546 |
| |
1545 | 1547 |
| |
1546 | 1548 |
| |
|
Lines changed: 3 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
7 | 7 |
| |
8 | 8 |
| |
9 | 9 |
| |
10 |
| - | |
| 10 | + | |
11 | 11 |
| |
12 | 12 |
| |
13 | 13 |
| |
| |||
155 | 155 |
| |
156 | 156 |
| |
157 | 157 |
| |
158 |
| - | |
| 158 | + | |
159 | 159 |
| |
160 |
| - | |
| 160 | + | |
161 | 161 |
| |
162 | 162 |
| |
163 | 163 |
| |
|
0 commit comments
Comments
(0)