- Notifications
You must be signed in to change notification settings - Fork5k
Commit202b127
committed
bufmgr: Improve stats when a buffer is read in concurrently
Previously we would have the following inaccuracies when a backend tried toread in a buffer, but that buffer was read in concurrently by another backend:- the read IO was double-counted in the global buffer access stats (pgBufferUsage)- the buffer hit was not accounted for in: - global buffer access statistics - pg_stat_io - relation level IO stats - vacuum cost balancingWhile trying to read in a buffer that is concurrently read in by anotherbackend is not a common occurrence, it's also not that rare, e.g. due toconcurrent sequential scans on the same relation. This scenario has becomemore likely in PG 17, due to the introducing of read streams, which can pinmultiple buffers before calling StartBufferIO() for all the buffers.This behaviour has historically grown, but there doesn't seem to be any reasonto continue with the wrong accounting.Reviewed-by: Melanie Plageman <melanieplageman@gmail.com>Discussion:https://postgr.es/m/CAAKRu_Zk-B08AzPsO-6680LUHLOCGaNJYofaxTFseLa=OepV1g@mail.gmail.com1 parent1260459 commit202b127
1 file changed
+22
-15
lines changedLines changed: 22 additions & 15 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1436 | 1436 |
| |
1437 | 1437 |
| |
1438 | 1438 |
| |
1439 |
| - | |
1440 |
| - | |
1441 |
| - | |
1442 |
| - | |
1443 |
| - | |
1444 |
| - | |
1445 |
| - | |
1446 |
| - | |
1447 |
| - | |
1448 |
| - | |
1449 |
| - | |
1450 |
| - | |
1451 |
| - | |
1452 | 1439 |
| |
1453 | 1440 |
| |
1454 | 1441 |
| |
| |||
1466 | 1453 |
| |
1467 | 1454 |
| |
1468 | 1455 |
| |
1469 |
| - | |
1470 |
| - | |
| 1456 | + | |
| 1457 | + | |
| 1458 | + | |
1471 | 1459 |
| |
1472 | 1460 |
| |
1473 | 1461 |
| |
1474 | 1462 |
| |
1475 | 1463 |
| |
1476 | 1464 |
| |
1477 | 1465 |
| |
| 1466 | + | |
| 1467 | + | |
| 1468 | + | |
| 1469 | + | |
| 1470 | + | |
| 1471 | + | |
| 1472 | + | |
| 1473 | + | |
| 1474 | + | |
| 1475 | + | |
| 1476 | + | |
| 1477 | + | |
| 1478 | + | |
| 1479 | + | |
1478 | 1480 |
| |
1479 | 1481 |
| |
1480 | 1482 |
| |
| |||
1560 | 1562 |
| |
1561 | 1563 |
| |
1562 | 1564 |
| |
| 1565 | + | |
| 1566 | + | |
| 1567 | + | |
| 1568 | + | |
| 1569 | + | |
1563 | 1570 |
| |
1564 | 1571 |
| |
1565 | 1572 |
| |
|
0 commit comments
Comments
(0)