Repository navigation
Description
What type of bug is this?
Unexpected error
What subsystems and features are affected?
Command processing, Query executor
What happened?
TimescaleDB: concurrent UPDATE/DELETE on a hypertable silently affects 0 rows (regression in 2.28.1)
Summary
Under the default READ COMMITTED isolation, when two transactions UPDATE (or DELETE) the
same hypertable row, the transaction that waits for the row lock reports UPDATE 0 /
DELETE 0 after the first one commits, and its change is silently dropped.
PostgreSQL re-checks the updated row version (EvalPlanQual) and reports UPDATE 1 for plain,
inherited and declaratively partitioned tables. TimescaleDB did the same up to and including
2.28.0. From 2.28.1 onwards, the row is skipped.
Reproduction (deterministic)
CREATE EXTENSION IF NOT EXISTS timescaledb;
CREATE TABLE hyper (id text, ts timestamp NOT NULL, action jsonb);
CREATE INDEX ON hyper (ts);
SELECT create_hypertable('hyper', 'ts', chunk_time_interval => interval '1 day');
INSERT INTO hyper VALUES ('a', '2026-10-27 08:53:48.174', '[]');
| Session 1 | Session 2 |
|---|---|
| BEGIN; | Β |
| UPDATE hyper SET action = action WHERE id = 'a' AND ts = '2026-10-27 08:53:48.174'; β UPDATE 1 | Β |
| Β | UPDATE hyper SET action = action WHERE id = 'a' AND ts = '2026-10-27 08:53:48.174'; (blocks) |
| COMMIT; | Β |
| Β | UPDATE 0 (expected UPDATE 1) |
The same happens with a waiting DELETE (DELETE 0, row remains) and with a primary key on
(id, ts).
Results
PostgreSQL 16.15, Apache-licensed builds from the release tags; PostgreSQL 14.19 for 2.5.1 and 2.19.3.
Also observed in production on timescale/timescaledb-ha:pg18.6-ts2.31.0.
| TimescaleDB | plain table | hypertable | hypertable + PK |
|---|---|---|---|
| 2.5.1 (PG14) | UPDATE 1 | UPDATE 1 | UPDATE 1 |
| 2.19.3 (PG14, PG16) | UPDATE 1 | UPDATE 1 | UPDATE 1 |
| 2.24.0 | UPDATE 1 | UPDATE 1 | β |
| 2.26.4 | UPDATE 1 | UPDATE 1 | β |
| 2.27.2 | UPDATE 1 | UPDATE 1 | β |
| 2.28.0 | UPDATE 1 | UPDATE 1 | β |
| 2.28.1 | UPDATE 1 | UPDATE 0 | β |
| 2.28.2 | UPDATE 1 | UPDATE 0 | β |
| 2.28.3 | UPDATE 1 | UPDATE 0 | UPDATE 0 |
| 2.29.0 | UPDATE 1 | UPDATE 0 | UPDATE 0 |
| 2.30.2 | UPDATE 1 | UPDATE 0 | UPDATE 0 |
| 2.31.0 | UPDATE 1 | UPDATE 0 | UPDATE 0 |
| main @ 217dafb (2026-10-26, 2.32.0-dev) | UPDATE 1 | UPDATE 0 | β |
Controls without TimescaleDB on the same server: an inheritance parent/child returns UPDATE 1,
and a declaratively partitioned table returns UPDATE 1.
Settings tried in session 2 on 2.31.0, none of which help:
timescaledb.enable_hypertable_expansion_for_dml = off, timescaledb.enable_optimizations = off,
timescaledb.enable_runtime_exclusion = off, timescaledb.enable_constraint_exclusion = off.
Workaround that works on 2.31.0: lock the row first in the same transaction,
SELECT β¦ FOR UPDATE then UPDATE β UPDATE 1.
Impact
Any application doing concurrent UPDATE or DELETE on hypertable rows under READ COMMITTED
loses writes silently. ORMs that check the row count, such as Ebean, raise
EntityNotFoundException: No rows updated. Raw SQL and PL/pgSQL code just continue.
TimescaleDB version affected
2.31
PostgreSQL version used
18.6
What operating system did you use?
Docker image timescale/timescaledb-ha:pg18.6-ts2.31.0, Linux.
What installation method did you use?
Docker
What platform did you run on?
Other
Relevant log output and stack trace
How can we reproduce the bug?
Default settings, READ COMMITTED isolation. You need two psql sessions connected to the same database.
Setup (either session):
sql
CREATE EXTENSION IF NOT EXISTS timescaledb;
CREATE TABLE hyper (id text, ts timestamp NOT NULL, action jsonb);
CREATE INDEX ON hyper (ts);
SELECT create_hypertable('hyper', 'ts', chunk_time_interval => interval '1 day');
INSERT INTO hyper VALUES ('a', '2026-10-27 08:53:48.174', '[]');
Session 1: start a transaction and update the row. Leave the transaction open.
sql
BEGIN;
UPDATE hyper SET action = action WHERE id = 'a' AND ts = '2026-10-27 08:53:48.174';
Result: UPDATE 1
Session 2: update the same row. This statement blocks, waiting for Session 1βs row lock.
sql
UPDATE hyper SET action = action WHERE id = 'a' AND ts = '2026-10-27 08:53:48.174';
Session 1: commit.
sql
COMMIT;
Session 2 now unblocks and prints its result.
Expected: UPDATE 1. Under READ COMMITTED, the waiting UPDATE should re-check the rowβs committed version and update it, as PostgreSQL does for plain, inherited and partitioned tables.
Actual: UPDATE 0. The row is skipped silently.
Activity
Recheck concurrent row updates on hypertables
Recheck concurrent row updates on hypertables
Recheck concurrent row updates on hypertables
Recheck concurrent row updates on hypertables
Recheck concurrent row updates on hypertables
Recheck concurrent row updates on hypertables
Release 2.23.0
Recheck concurrent row updates on hypertables