Skip to content

Commit c9fd1f5

Browse files
committed
Add TIL post about Postgresql 55000 error
1 parent 6e410bb commit c9fd1f5

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
title: PostgreSQL 55000 error
3+
date: 2023-11-21
4+
tags: [til, postgresql]
5+
description: What was the root cause of PostgreSQL 55000 error in our case
6+
---
7+
8+
We had a Kafka consumer which was crashing with the error below
9+
10+
```elixir
11+
(Postgrex.Error ERROR 55000 (object_not_in_prerequisite_state) recovery is in progress
12+
13+
hint: WAL control functions cannot be executed during recovery.)
14+
```
15+
16+
In that consumer module, there was a function which was eventually trying to get the LSN from the DB by querying something like
17+
18+
```
19+
SELECT pg_last_wal_replay_lsn()::varchar
20+
```
21+
22+
It turns out we were actually querying a replica where WAL was enabled, figured that out quite quickly by asking in #postgresql IRC.
23+
24+
> 10:49 < Berge> Note that a replica (using WAL replication) is considered to be in recovery
25+
26+
Thank you Berge! TIL!

0 commit comments

Comments
 (0)