Summary:
This revision adds proper population of the `pg_stat_replication_slot` view by adding PG's statistics system within YB enabled code path.
The implementation modifies the replication slot code paths to properly initialize, update, and clean up replication statistics. Key changes include populating the `ReplicationSlotCtl` array when a slot is acquired, updating metrics via `UpdateDecodingStats` method by adding it in the `ReorderBufferReplay` method, and ensuring proper cleanup when slots are dropped.
Additional changes include using `yb_reorderbuffer_max_changes_in_memory` for spill decisions.
With this revision `max_replication_slots` gFlag is made a common flag, available in both tserver as well as master, and is used to allocate memory for the cache on each node apart from controlling the maximum number of replication slots that are allowed to exist.
Jira: DB-14769
Test Plan:
./yb_build.sh --java-test 'org.yb.pgsql.TestPgReplicationSlot#testPgStatReplicationSlots'
./yb_build.sh --java-test 'org.yb.pgsql.TestPgReplicationSlot#testPgStatReplicationSlotsWithMultipleSlots'
Reviewers: skumar, vkushwaha, sumukh.phalgaonkar, stiwary, aagrawal, asrinivasan
Reviewed By: asrinivasan
Subscribers: yql
Tags: #jenkins-ready
Differential Revision: https://phorge.dev.yugabyte.com/D43614