-
Notifications
You must be signed in to change notification settings - Fork 17
Description
During NS8 Samba module restore, the TimescaleDB container may fail while restoring the samba_audit database. The failure is caused by a race condition between CREATE EXTENSION timescaledb, background worker initialization, and the early execution of timescaledb_pre_restore(). As a result, internal TimescaleDB catalog objects are missing when pg_restore starts, causing the restore to abort. The issue is more reproducible when the database to restore is almost empty.
Steps to reproduce
- Install NS8 and the Samba DC with VPN IP address
- Generate a backup where the
samba_auditdatabase is empty or almost empty - Restore the backup on a new cluster or node
- Observe the Samba module restore task failing at the TimescaleDB restore step
Expected behavior
The Samba module restore completes successfully, restoring (or recreating) the samba_audit database even when it contains little or no data.
Actual behavior
The restore aborts with errors like:
- relation
_timescaledb_catalog.chunk_indexdoes not exist - function
_timescaledb_functions.insert_blocker()does not exist
The failure occurs after timescaledb_pre_restore() terminates TimescaleDB background workers before internal catalogs are fully initialized.
Log excerpt:
Restore samba_audit data in TimescaleDB:
CREATE DATABASE
CREATE EXTENSION
2026-01-26 15:29:26.416 UTC [41] LOG: TimescaleDB background worker launcher connected to shared catalogs
timescaledb_pre_restore
(1 row)
2026-01-26 15:29:26.861 UTC [52] FATAL: terminating background worker "TimescaleDB Background Worker Scheduler" due to administrator command
2026-01-26 15:29:26.864 UTC [35] LOG: background worker "TimescaleDB Background Worker Scheduler" (PID 52) exited with exit code 1
2026-01-26 15:29:26.889 UTC [54] ERROR: relation "_timescaledb_catalog.chunk_index" does not exist
2026-01-26 15:29:26.889 UTC [54] STATEMENT: COPY _timescaledb_catalog.chunk_index (...) FROM stdin;
2026-01-26 15:29:26.910 UTC [54] ERROR: function _timescaledb_functions.insert_blocker() does not exist
2026-01-26 15:29:26.910 UTC [54] STATEMENT: CREATE TRIGGER ts_insert_blocker ...
Components
- NethServer Core 3.16
- Samba DC 3.4.1
See also
- TimescaleDB documentation on
timescaledb_pre_restore()and restore ordering - Internal discussion about Samba restore failures with empty audit DBs https://mattermost.nethesis.it/nethesis/pl/4xdtnseanfdoxmzg85cnjxo8uw
Acknowledgements
Thanks to @nrauso
Metadata
Metadata
Assignees
Labels
Type
Projects
Status