forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitd6e171f
committed
Keep replication slot statistics on invalidation
The code path in charge of invalidating a replication slot includes acall to pgstat_drop_replslot(), which would result in removing thestatistics of the slot once invalidated. However, there is no need toremove the statistics of an invalidated slot as one could still beinterested in looking at them to understand the activity of the slotuntil its actual removal.The initial design of the feature committed inbe87200 used theapproach to drop the slots, which is likely why the statistics werestill removed during the invalidation.Another problem with this operation is that it was done without holdingReplicationSlotAllocationLock, leaving it unprotected on concurrentactivity. This part is arguably a bug, but that's a limited problem inpractice so no backpatch is done.In passing, this commit adds a test to check this behavior. The onlyremaining code path where slot statistics are dropped now related to theslot getting dropped.Author: Bertrand DrouvotDiscussion:https://postgr.es/m/ZermH08Eq6YydHpO@ip-10-97-1-34.eu-west-3.compute.internal1 parent397cd0b commitd6e171f
File tree
2 files changed
+20
-1
lines changed- src
- backend/replication
- test/recovery/t
2 files changed
+20
-1
lines changedLines changed: 0 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1726 | 1726 |
| |
1727 | 1727 |
| |
1728 | 1728 |
| |
1729 |
| - | |
1730 | 1729 |
| |
1731 | 1730 |
| |
1732 | 1731 |
| |
|
Lines changed: 20 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
494 | 494 |
| |
495 | 495 |
| |
496 | 496 |
| |
| 497 | + | |
| 498 | + | |
| 499 | + | |
497 | 500 |
| |
498 | 501 |
| |
499 | 502 |
| |
| |||
502 | 505 |
| |
503 | 506 |
| |
504 | 507 |
| |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
505 | 517 |
| |
506 | 518 |
| |
507 | 519 |
| |
| |||
515 | 527 |
| |
516 | 528 |
| |
517 | 529 |
| |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
518 | 538 |
| |
519 | 539 |
| |
520 | 540 |
| |
|
0 commit comments
Comments
(0)