• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

orioledb / orioledb / 23640539948
90%

Build:
DEFAULT BRANCH: main
Ran 27 Mar 2026 11:11AM UTC
Jobs 1
Files 92
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

27 Mar 2026 09:49AM UTC coverage: 89.805% (-0.001%) from 89.806%
23640539948

push

github

pgnickb
Fix pgstat assertion failure during recovery worker error unwind

When a (parallel) recovery worker encounters an exception (e.g., unexpected
queue detach, ENOSPC or even just a shutdown with an unfortunate timing) after
a `SharedFileSet` has been allocated and spilled to disk, it triggers a
`SIGABRT` due to an assertion failure in `pgstat_assert_is_up()`.

Conditions:
1. The exception triggers the `PG_CATCH` block in `recovery_worker_main`, which
   executes `PG_RE_THROW()`.
2. `PG_RE_THROW()` performs a `siglongjmp` to `StartBackgroundWorker`'s
   exception handler, initiating `proc_exit(1)`.
3. `proc_exit(1)` executes `shmem_exit(1)`, which strictly orders subsystem
   teardown:
  i. Executes `before_shmem_exit` callbacks, which forcibly shuts down the
     `pgstat` subsystem.
  ii. Executes `dsm_backend_shutdown()` to clean up leaked Dynamic Shared
      Memory (DSM) segments.
4. The leaked DSM segment containing the `SharedFileSet` triggers the
   `SharedFileSetOnDetach` callback.
5. The callback unlinks the temporary files and calls `pgstat_report_tempfile()`
   to decrement the backend's storage counters.
6. Because the `pgstat` subsystem was destroyed in step 1, the
   `pgstat_is_initialized && !pgstat_is_shutdown` assertion fails.

Fix:

Explicitly release `CurrentResourceOwner` resources within the `PG_CATCH` block
before `PG_RE_THROW()`. A new function `ResourceOwnerRelease` explicitly
detaches DSM segments and the `SharedFileSet` files are deleted and reported to
`pgstat` before the statistics subsystem tear down.

45284 of 50425 relevant lines covered (89.8%)

66763240.94 hits per line

Coverage Regressions

Lines Coverage ∆ File
18
96.54
0.07% orioledb/src/recovery/worker.c
9
90.89
-0.41% orioledb/src/recovery/recovery.c
9
91.25
-1.21% orioledb/src/s3/headers.c
6
72.02
-1.66% orioledb/src/utils/seq_buf.c
3
70.62
-0.49% orioledb/src/btree/fastpath.c
2
90.72
-0.06% orioledb/src/checkpoint/checkpoint.c
2
93.09
-0.14% orioledb/src/transam/undo.c
1
90.61
0.0% orioledb/src/catalog/ddl.c
1
96.99
-0.75% orioledb/src/utils/page_pool.c
Jobs
ID Job ID Ran Files Coverage
1 23640539948.1 27 Mar 2026 11:11AM UTC 92
89.8
GitHub Action Run
Source Files on build 23640539948
  • Tree
  • List 92
  • Changed 17
  • Source Changed 1
  • Coverage Changed 17
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #23640539948
  • b6f8dbab on github
  • Prev Build on main (#23542836354)
  • Next Build on main (#23653157427)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc