PG 15, Debezium 3.6.0 Final, Confluent Kafka (still). I did also post this to the zulip forum here, I understand it may be bad form to double-post but we're getting quite frazzled.
We have two debezium apps, each pointing to a completely different PG instance (separate hosts, etc). We performed another failover last night. One of the debezium apps started up just fine, the other failed with the "last recorded offset is no longer available on the server" error. It was looking for an LSN that was from about 15 minutes prior the failover.
Here is our failover process:
Last night at step 6 is when we observed the problem so we held off.
I'm trying to play out how it would be that the one app is looking for an old record. Last night we stopped debezium around 19:14, then stopped PG around 19:36. The LSN that debezium asked for after restarting was in a WAL file that logs show was archived around 19:15. The only theory I have is that Debezium somehow had not finished processing its queue to send to Kafka. What's odd is that the other app is much busier and didn't have any such problem (if that is indeed the case).
Are there any sort of checks or metrics exposed that we can tell if Debezium is still processing or if it's otherwise idle? Any other possible causes? If we can be certain that all data was processed, then there's no data lost and we can just set offset.mismatch.strategy to trust_slot again as before. But ideally we shouldn't see this problem in a planned DR failover unless our process is still flawed here.