forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit89962bf
committed
postgres_fdw: re-issue cancel requests a few times if necessary.
Despite the best efforts of commit0e5c823, we're still seeingoccasional failures of postgres_fdw's query_cancel test in thebuildfarm. Investigation suggests that its 100ms timeout isstill not enough to reliably ensure that the remote side startsthe query before receiving the cancel request --- and if ithasn't, it will just discard the request because it's idle.We discussed allowing a cancel request to kill the next-receivedquery, but that would have wide and perhaps unpleasant side-effects.What seems safer is to make postgres_fdw do what a human user wouldlikely do, which is issue another cancel request if the first onedidn't seem to do anything. We'll keep the same overall 30 secondgrace period before concluding things are broken, but issue additionalcancel requests after 1 second, then 2 more seconds, then 4, then 8.(The next one in series is 16 seconds, but we'll hit the 30 secondtimeout before that.)Having done that, revert the timeout in query_cancel.sql to 10 ms.That will still be enough on most machines, most of the time, forthe remote query to start; but now we're intentionally risking therace condition occurring sometimes in the buildfarm, so that therepeat-cancel code path will get some testing.As before, back-patch to v17. We might eventually contemplateback-patching this further, and/or adding similar logic to dblink.But given the lack of field complaints to date, this feels likemostly an exercise in test case stabilization, so v17 is enough.Discussion:https://postgr.es/m/colnv3lzzmc53iu5qoawynr6qq7etn47lmggqr65ddtpjliq5d@glkveb4m6nop1 parentbbe68c1 commit89962bf
File tree
3 files changed
+84
-24
lines changed- contrib/postgres_fdw
- expected
- sql
3 files changed
+84
-24
lines changedLines changed: 76 additions & 20 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
95 | 95 |
| |
96 | 96 |
| |
97 | 97 |
| |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
98 | 105 |
| |
99 | 106 |
| |
100 | 107 |
| |
| |||
135 | 142 |
| |
136 | 143 |
| |
137 | 144 |
| |
| 145 | + | |
138 | 146 |
| |
139 | 147 |
| |
140 | 148 |
| |
| |||
144 | 152 |
| |
145 | 153 |
| |
146 | 154 |
| |
| 155 | + | |
147 | 156 |
| |
148 | 157 |
| |
149 | 158 |
| |
| |||
1308 | 1317 |
| |
1309 | 1318 |
| |
1310 | 1319 |
| |
| 1320 | + | |
1311 | 1321 |
| |
| 1322 | + | |
1312 | 1323 |
| |
1313 | 1324 |
| |
1314 | 1325 |
| |
1315 | 1326 |
| |
1316 | 1327 |
| |
1317 |
| - | |
1318 |
| - | |
| 1328 | + | |
| 1329 | + | |
| 1330 | + | |
| 1331 | + | |
| 1332 | + | |
| 1333 | + | |
| 1334 | + | |
1319 | 1335 |
| |
1320 | 1336 |
| |
1321 | 1337 |
| |
1322 |
| - | |
| 1338 | + | |
1323 | 1339 |
| |
1324 | 1340 |
| |
1325 | 1341 |
| |
| |||
1345 | 1361 |
| |
1346 | 1362 |
| |
1347 | 1363 |
| |
1348 |
| - | |
| 1364 | + | |
| 1365 | + | |
1349 | 1366 |
| |
1350 |
| - | |
| 1367 | + | |
1351 | 1368 |
| |
1352 | 1369 |
| |
1353 | 1370 |
| |
| |||
1366 | 1383 |
| |
1367 | 1384 |
| |
1368 | 1385 |
| |
1369 |
| - | |
| 1386 | + | |
| 1387 | + | |
1370 | 1388 |
| |
1371 | 1389 |
| |
1372 | 1390 |
| |
| |||
1439 | 1457 |
| |
1440 | 1458 |
| |
1441 | 1459 |
| |
1442 |
| - | |
| 1460 | + | |
1443 | 1461 |
| |
1444 | 1462 |
| |
1445 | 1463 |
| |
| |||
1457 | 1475 |
| |
1458 | 1476 |
| |
1459 | 1477 |
| |
1460 |
| - | |
| 1478 | + | |
1461 | 1479 |
| |
1462 | 1480 |
| |
1463 | 1481 |
| |
| |||
1481 | 1499 |
| |
1482 | 1500 |
| |
1483 | 1501 |
| |
1484 |
| - | |
1485 |
| - | |
1486 |
| - | |
1487 |
| - | |
| 1502 | + | |
| 1503 | + | |
| 1504 | + | |
| 1505 | + | |
| 1506 | + | |
| 1507 | + | |
| 1508 | + | |
| 1509 | + | |
1488 | 1510 |
| |
1489 |
| - | |
1490 |
| - | |
1491 |
| - | |
1492 |
| - | |
| 1511 | + | |
| 1512 | + | |
| 1513 | + | |
1493 | 1514 |
| |
1494 | 1515 |
| |
1495 |
| - | |
| 1516 | + | |
| 1517 | + | |
| 1518 | + | |
1496 | 1519 |
| |
1497 | 1520 |
| |
1498 | 1521 |
| |
1499 | 1522 |
| |
1500 | 1523 |
| |
| 1524 | + | |
1501 | 1525 |
| |
1502 | 1526 |
| |
1503 | 1527 |
| |
1504 | 1528 |
| |
1505 | 1529 |
| |
| 1530 | + | |
| 1531 | + | |
1506 | 1532 |
| |
1507 | 1533 |
| |
1508 | 1534 |
| |
| |||
1513 | 1539 |
| |
1514 | 1540 |
| |
1515 | 1541 |
| |
| 1542 | + | |
| 1543 | + | |
| 1544 | + | |
| 1545 | + | |
| 1546 | + | |
| 1547 | + | |
| 1548 | + | |
| 1549 | + | |
| 1550 | + | |
| 1551 | + | |
| 1552 | + | |
| 1553 | + | |
| 1554 | + | |
| 1555 | + | |
| 1556 | + | |
| 1557 | + | |
| 1558 | + | |
| 1559 | + | |
| 1560 | + | |
| 1561 | + | |
| 1562 | + | |
| 1563 | + | |
| 1564 | + | |
1516 | 1565 |
| |
1517 |
| - | |
| 1566 | + | |
| 1567 | + | |
| 1568 | + | |
1518 | 1569 |
| |
1519 | 1570 |
| |
1520 | 1571 |
| |
| |||
1835 | 1886 |
| |
1836 | 1887 |
| |
1837 | 1888 |
| |
| 1889 | + | |
1838 | 1890 |
| |
| 1891 | + | |
1839 | 1892 |
| |
1840 | 1893 |
| |
1841 | 1894 |
| |
| |||
1849 | 1902 |
| |
1850 | 1903 |
| |
1851 | 1904 |
| |
1852 |
| - | |
| 1905 | + | |
1853 | 1906 |
| |
| 1907 | + | |
| 1908 | + | |
1854 | 1909 |
| |
1855 |
| - | |
| 1910 | + | |
| 1911 | + | |
1856 | 1912 |
| |
1857 | 1913 |
| |
1858 | 1914 |
| |
|
Lines changed: 4 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
24 | 24 |
| |
25 | 25 |
| |
26 | 26 |
| |
27 |
| - | |
28 |
| - | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
29 | 31 |
| |
30 | 32 |
| |
31 | 33 |
| |
|
Lines changed: 4 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
13 | 13 |
| |
14 | 14 |
| |
15 | 15 |
| |
16 |
| - | |
17 |
| - | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
18 | 20 |
| |
19 | 21 |
| |
20 | 22 |
|
0 commit comments
Comments
(0)