ProvSQL C/C++ API
Adding support for provenance and uncertainty management to PostgreSQL databases
Loading...
Searching...
No Matches
provsqlSharedState Struct Reference

Shared state stored in the PostgreSQL shared-memory segment. More...

#include "provsql_shmem.h"

Public Attributes

LWLock * lock
 Mutual-exclusion lock for pipe writes.
long pipebmr
 Backend-to-worker pipe: read end (worker reads).
long pipebmw
 Backend-to-worker pipe: write end (backends write).
long pipembr
 Worker-to-backend pipe: read end (backends read).
long pipembw
 Worker-to-backend pipe: write end (worker writes).
char kcmcp_endpoint [256]
 Live endpoint of the managed KCMCP server ("" when none): written by the supervisor worker, read by the in-extension client.
bool worker_ready
 The MMap worker reads the pipe: set by it under lock once it has taken the replay spool.
pg_atomic_uint32 cancel_request
 Set by the backend holding lock.

Detailed Description

Shared state stored in the PostgreSQL shared-memory segment.

All backends and the background worker access this structure through the provsql_shared_state global pointer.

lock serialises gate-creation messages so that only one backend writes to the pipe at a time. The four long fields hold OS file descriptors for the two anonymous pipes:

  • pipebmr / pipebmw: requests, backend → worker (backends write)
  • pipembr / pipembw: replies, worker → backend (worker writes)

Definition at line 112 of file provsql_shmem.h.

Member Data Documentation

◆ cancel_request

pg_atomic_uint32 provsqlSharedState::cancel_request

Set by the backend holding lock.

when its statement is cancelled while it waits for a circuit: the worker then stops building it (see provsql_wait_reply).

Definition at line 127 of file provsql_shmem.h.

◆ kcmcp_endpoint

char provsqlSharedState::kcmcp_endpoint[256]

Live endpoint of the managed KCMCP server ("" when none): written by the supervisor worker, read by the in-extension client.

Definition at line 119 of file provsql_shmem.h.

◆ lock

LWLock* provsqlSharedState::lock

Mutual-exclusion lock for pipe writes.

Definition at line 114 of file provsql_shmem.h.

◆ pipebmr

long provsqlSharedState::pipebmr

Backend-to-worker pipe: read end (worker reads).

Definition at line 115 of file provsql_shmem.h.

◆ pipebmw

long provsqlSharedState::pipebmw

Backend-to-worker pipe: write end (backends write).

Definition at line 116 of file provsql_shmem.h.

◆ pipembr

long provsqlSharedState::pipembr

Worker-to-backend pipe: read end (backends read).

Definition at line 117 of file provsql_shmem.h.

◆ pipembw

long provsqlSharedState::pipembw

Worker-to-backend pipe: write end (worker writes).

Definition at line 118 of file provsql_shmem.h.

◆ worker_ready

bool provsqlSharedState::worker_ready

The MMap worker reads the pipe: set by it under lock once it has taken the replay spool.

False until then, after a crash restart included, when the worker starts only after recovery (see provsql_replay_store_message).

Definition at line 122 of file provsql_shmem.h.


The documentation for this struct was generated from the following file: