replicase / pgcapture

A scalable Netflix DBLog implementation for PostgreSQL
Apache License 2.0
220 stars 31 forks source link

fix: solve the cursor not been replicated issue for the subscription tracker #44

Closed benjamin99 closed 1 year ago

benjamin99 commented 1 year ago

Description

The PR is for solving the issue #45 . In the previous implementations, the consumer of the subscription trackers would not actually consume the incoming messages. As a consequence, the message permits of the consumer would eventually been reduced to zero, and the broker would stop pushing messages to the consumer, which also meant that the consumer's replication snapshot cache would not be able to update to the latest version. Upon acknowledging these messages, the broker encountered difficulty in locating the relevant replication snapshot within the outdated cache. As a result, the cursor was unable to replicate the latest position to the remote cluster(s).

To solve the issue, the PR added the additional go routine in the subscription tracker to drain the messages in the message queue.

fix #45