|
PostgreSQL Source Code git master
|
#include "postgres.h"#include <limits.h>#include <unistd.h>#include <signal.h>#include "access/parallel.h"#include "access/slru.h"#include "access/transam.h"#include "access/xact.h"#include "catalog/pg_database.h"#include "commands/async.h"#include "common/hashfn.h"#include "funcapi.h"#include "lib/dshash.h"#include "libpq/libpq.h"#include "libpq/pqformat.h"#include "miscadmin.h"#include "storage/dsm_registry.h"#include "storage/ipc.h"#include "storage/latch.h"#include "storage/lmgr.h"#include "storage/procsignal.h"#include "tcop/tcopprot.h"#include "utils/builtins.h"#include "utils/dsa.h"#include "utils/guc_hooks.h"#include "utils/memutils.h"#include "utils/ps_status.h"#include "utils/snapmgr.h"#include "utils/timestamp.h"
Go to the source code of this file.
Data Structures | |
| struct | AsyncQueueEntry |
| struct | QueuePosition |
| struct | QueueBackendStatus |
| struct | AsyncQueueControl |
| struct | GlobalChannelKey |
| struct | ListenerEntry |
| struct | GlobalChannelEntry |
| struct | ListenAction |
| struct | ActionList |
| struct | PendingListenEntry |
| struct | Notification |
| struct | NotificationList |
| struct | NotificationHash |
| struct | ChannelName |
Typedefs | |
| typedef struct AsyncQueueEntry | AsyncQueueEntry |
| typedef struct QueuePosition | QueuePosition |
| typedef struct QueueBackendStatus | QueueBackendStatus |
| typedef struct AsyncQueueControl | AsyncQueueControl |
| typedef struct GlobalChannelKey | GlobalChannelKey |
| typedef struct ListenerEntry | ListenerEntry |
| typedef struct GlobalChannelEntry | GlobalChannelEntry |
| typedef struct ActionList | ActionList |
| typedef struct PendingListenEntry | PendingListenEntry |
| typedef struct Notification | Notification |
| typedef struct NotificationList | NotificationList |
| typedef struct ChannelName | ChannelName |
Enumerations | |
| enum | ListenActionKind { LISTEN_LISTEN , LISTEN_UNLISTEN , LISTEN_UNLISTEN_ALL } |
| enum | PendingListenAction { PENDING_LISTEN , PENDING_UNLISTEN } |
| #define AsyncQueueEntryEmptySize (offsetof(AsyncQueueEntry, data) + 2) |
| #define LocalChannelTableIsEmpty | ( | ) | (localChannelTable == NULL || hash_get_num_entries(localChannelTable) == 0) |
Definition at line 411 of file async.c.
| #define NOTIFY_PAYLOAD_MAX_LENGTH (BLCKSZ - NAMEDATALEN - 128) |
| #define NotifyCtl (&NotifyCtlData) |
| #define QUEUE_BACKEND_DBOID | ( | i | ) | (asyncQueueControl->backend[i].dboid) |
| #define QUEUE_BACKEND_IS_ADVANCING | ( | i | ) | (asyncQueueControl->backend[i].isAdvancing) |
| #define QUEUE_BACKEND_PID | ( | i | ) | (asyncQueueControl->backend[i].pid) |
| #define QUEUE_BACKEND_POS | ( | i | ) | (asyncQueueControl->backend[i].pos) |
| #define QUEUE_BACKEND_WAKEUP_PENDING | ( | i | ) | (asyncQueueControl->backend[i].wakeupPending) |
| #define QUEUE_FIRST_LISTENER (asyncQueueControl->firstListener) |
| #define QUEUE_HEAD (asyncQueueControl->head) |
| #define QUEUE_NEXT_LISTENER | ( | i | ) | (asyncQueueControl->backend[i].nextListener) |
| #define QUEUE_STOP_PAGE (asyncQueueControl->stopPage) |
| #define QUEUE_TAIL (asyncQueueControl->tail) |
| typedef struct ActionList ActionList |
| typedef struct ChannelName ChannelName |
| typedef struct ListenerEntry ListenerEntry |
| typedef struct Notification Notification |
| typedef struct QueuePosition QueuePosition |
|
static |
Definition at line 3158 of file async.c.
References Assert, CurTransactionContext, Notification::data, NotificationList::events, fb(), HASH_COMPARE, HASH_CONTEXT, hash_create(), HASH_ELEM, HASH_ENTER, HASH_FUNCTION, hash_search(), HASH_STRINGS, NotificationList::hashtab, lappend(), lfirst, list_length(), MIN_HASHABLE_NOTIFIES, NAMEDATALEN, NIL, notification_hash(), notification_match(), pendingNotifies, and NotificationList::uniqueChannelHash.
Referenced by Async_Notify(), and AtSubCommit_Notify().
Definition at line 1713 of file async.c.
References PendingListenEntry::action, PendingListenEntry::channel, dsa_get_address(), dshash_find(), dshash_release_lock(), elog, fb(), globalChannelDSA, GlobalChannelKeyInit(), globalChannelTable, HASH_REMOVE, hash_search(), hash_seq_init(), hash_seq_search(), i, GlobalChannelEntry::listenersArray, ListenerEntry::listening, localChannelTable, MyDatabaseId, MyProcNumber, GlobalChannelEntry::numListeners, PANIC, PENDING_LISTEN, pendingListenActions, and RemoveListenerFromChannel().
Referenced by AtAbort_Notify(), and AtCommit_Notify().
Definition at line 1035 of file async.c.
References DEBUG1, elog, LISTEN_LISTEN, MyProcPid, queue_listen(), and Trace_notify.
Referenced by standard_ProcessUtility().
Definition at line 886 of file async.c.
References AddEventToPendingNotifies(), AsyncExistsPendingNotify(), Notification::channel_len, CurTransactionContext, Notification::data, data, DEBUG1, elog, ereport, errcode(), errmsg(), ERROR, fb(), GetCurrentTransactionNestLevel(), IsParallelWorker, list_make1, MemoryContextAlloc(), MemoryContextSwitchTo(), NAMEDATALEN, NotificationList::nestingLevel, NIL, NOTIFY_PAYLOAD_MAX_LENGTH, palloc(), Notification::payload_len, pendingNotifies, pfree(), TopTransactionContext, and Trace_notify.
Referenced by pg_notify(), standard_ProcessUtility(), and triggered_change_notification().
Definition at line 1049 of file async.c.
References DEBUG1, elog, fb(), LISTEN_UNLISTEN, MyProcPid, pendingActions, queue_listen(), Trace_notify, and unlistenExitRegistered.
Referenced by standard_ProcessUtility().
Definition at line 1067 of file async.c.
References DEBUG1, elog, fb(), LISTEN_UNLISTEN_ALL, MyProcPid, pendingActions, queue_listen(), Trace_notify, and unlistenExitRegistered.
Referenced by DiscardAll(), and standard_ProcessUtility().
Definition at line 1139 of file async.c.
References asyncQueueUnregister(), and CleanupListenersOnExit().
Referenced by BecomeRegisteredListener().
|
static |
Definition at line 3117 of file async.c.
References Notification::channel_len, Notification::data, NotificationList::events, fb(), HASH_FIND, hash_search(), NotificationList::hashtab, lfirst, Notification::payload_len, and pendingNotifies.
Referenced by Async_Notify(), and AtSubCommit_Notify().
| void AsyncNotifyFreezeXids | ( | TransactionId | newFrozenXid | ) |
Definition at line 2945 of file async.c.
References asyncQueueAdvance(), fb(), FrozenTransactionId, InvalidTransactionId, LW_EXCLUSIVE, LW_SHARED, LWLockAcquire(), LWLockRelease(), NotifyCtl, QUEUE_HEAD, QUEUE_POS_EQUAL, QUEUE_POS_OFFSET, QUEUE_POS_PAGE, QUEUE_TAIL, SimpleLruGetBankLock(), SimpleLruReadPage(), TransactionIdDidCommit(), TransactionIdIsNormal, and TransactionIdPrecedes().
Referenced by vac_truncate_clog().
Definition at line 2035 of file async.c.
References asyncQueueAdvance(), asyncQueueNotificationToEntry(), NotificationList::events, fb(), InvalidOid, InvalidTransactionId, lfirst, lnext(), LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), NotifyCtl, pendingNotifies, QUEUE_CLEANUP_DELAY, QUEUE_HEAD, QUEUE_PAGESIZE, QUEUE_POS_IS_ZERO, QUEUE_POS_OFFSET, QUEUE_POS_PAGE, SimpleLruGetBankLock(), SimpleLruReadPage(), SimpleLruZeroPage(), and tryAdvanceTail.
Referenced by PreCommit_Notify().
|
static |
Definition at line 1966 of file async.c.
References Assert, AsyncQueueEntryEmptySize, fb(), QUEUE_PAGESIZE, QUEUE_POS_OFFSET, QUEUE_POS_PAGE, QUEUEALIGN, and SET_QUEUE_POS.
Referenced by AsyncNotifyFreezeXids(), asyncQueueAddEntries(), and asyncQueueProcessPageEntries().
Definition at line 2863 of file async.c.
References Assert, asyncQueuePagePrecedes(), fb(), i, INVALID_PROC_NUMBER, InvalidPid, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), NotifyCtl, QUEUE_BACKEND_PID, QUEUE_BACKEND_POS, QUEUE_FIRST_LISTENER, QUEUE_HEAD, QUEUE_NEXT_LISTENER, QUEUE_POS_MIN, QUEUE_POS_PAGE, QUEUE_STOP_PAGE, QUEUE_TAIL, SimpleLruTruncate(), and SLRU_PAGES_PER_SEGMENT.
Referenced by AtCommit_Notify(), and pg_notification_queue_usage().
Definition at line 2207 of file async.c.
References Assert, asyncQueueControl, asyncQueueUsage(), ereport, errdetail(), errhint(), errmsg(), fb(), GetCurrentTimestamp(), i, INVALID_PROC_NUMBER, InvalidPid, AsyncQueueControl::lastQueueFillWarn, QUEUE_BACKEND_PID, QUEUE_BACKEND_POS, QUEUE_FIRST_LISTENER, QUEUE_FULL_WARN_INTERVAL, QUEUE_HEAD, QUEUE_NEXT_LISTENER, QUEUE_POS_EQUAL, QUEUE_POS_MIN, TimestampDifferenceExceeds(), and WARNING.
Referenced by PreCommit_Notify().
Definition at line 1951 of file async.c.
References fb(), max_notify_queue_pages, QUEUE_HEAD, QUEUE_POS_PAGE, and QUEUE_TAIL.
Referenced by PreCommit_Notify().
|
static |
Definition at line 1999 of file async.c.
References Assert, AsyncQueueEntryEmptySize, Notification::channel_len, Notification::data, fb(), GetCurrentTransactionId(), MyDatabaseId, MyProcPid, NAMEDATALEN, NOTIFY_PAYLOAD_MAX_LENGTH, Notification::payload_len, and QUEUEALIGN.
Referenced by asyncQueueAddEntries().
Definition at line 628 of file async.c.
Referenced by asyncQueueAdvanceTail(), and AsyncShmemInit().
|
static |
Definition at line 2724 of file async.c.
References Assert, asyncQueueAdvance(), AsyncQueueEntry::data, fb(), InvalidTransactionId, IsListeningOn(), LocalChannelTableIsEmpty, LWLockRelease(), MyDatabaseId, NotifyCtl, NotifyMyFrontEnd(), QUEUE_PAGESIZE, QUEUE_POS_EQUAL, QUEUE_POS_OFFSET, QUEUE_POS_PAGE, SimpleLruGetBankLock(), SimpleLruReadPage_ReadOnly(), TransactionIdDidCommit(), and XidInMVCCSnapshot().
Referenced by asyncQueueReadAllNotifications().
Definition at line 2590 of file async.c.
References Assert, asyncQueueProcessPageEntries(), ExitOnAnyError, fb(), GetLatestSnapshot(), LW_SHARED, LWLockAcquire(), LWLockRelease(), MyProcNumber, MyProcPid, QUEUE_BACKEND_IS_ADVANCING, QUEUE_BACKEND_PID, QUEUE_BACKEND_POS, QUEUE_BACKEND_WAKEUP_PENDING, QUEUE_HEAD, QUEUE_POS_EQUAL, RegisterSnapshot(), and UnregisterSnapshot().
Referenced by BecomeRegisteredListener(), and ProcessIncomingNotify().
Definition at line 1908 of file async.c.
References amRegisteredListener, Assert, fb(), i, INVALID_PROC_NUMBER, InvalidOid, InvalidPid, LocalChannelTableIsEmpty, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), MyProcNumber, QUEUE_BACKEND_DBOID, QUEUE_BACKEND_IS_ADVANCING, QUEUE_BACKEND_PID, QUEUE_BACKEND_WAKEUP_PENDING, QUEUE_FIRST_LISTENER, and QUEUE_NEXT_LISTENER.
Referenced by Async_UnlistenOnExit(), AtAbort_Notify(), and AtCommit_Notify().
Definition at line 2186 of file async.c.
References fb(), max_notify_queue_pages, QUEUE_HEAD, QUEUE_POS_PAGE, and QUEUE_TAIL.
Referenced by asyncQueueFillWarning(), and pg_notification_queue_usage().
Definition at line 793 of file async.c.
References add_size(), asyncQueueControl, asyncQueuePagePrecedes(), DSA_HANDLE_INVALID, DSHASH_HANDLE_INVALID, fb(), AsyncQueueControl::globalChannelTableDSA, AsyncQueueControl::globalChannelTableDSH, i, INVALID_PROC_NUMBER, InvalidOid, InvalidPid, AsyncQueueControl::lastQueueFillWarn, MaxBackends, mul_size(), notify_buffers, NotifyCtl, QUEUE_BACKEND_DBOID, QUEUE_BACKEND_IS_ADVANCING, QUEUE_BACKEND_PID, QUEUE_BACKEND_POS, QUEUE_BACKEND_WAKEUP_PENDING, QUEUE_FIRST_LISTENER, QUEUE_HEAD, QUEUE_NEXT_LISTENER, QUEUE_STOP_PAGE, QUEUE_TAIL, SET_QUEUE_POS, ShmemInitStruct(), SimpleLruInit(), SlruScanDirCbDeleteAll(), SlruScanDirectory(), and SYNC_HANDLER_NONE.
Referenced by CreateOrAttachShmemStructs().
Definition at line 776 of file async.c.
References add_size(), fb(), MaxBackends, mul_size(), notify_buffers, and SimpleLruShmemSize().
Referenced by CalculateShmemSize().
Definition at line 2411 of file async.c.
References amRegisteredListener, ApplyPendingListenActions(), asyncQueueUnregister(), ClearPendingActionsAndNotifies(), and LocalChannelTableIsEmpty.
Referenced by AbortTransaction().
Definition at line 1370 of file async.c.
References amRegisteredListener, ApplyPendingListenActions(), asyncQueueAdvanceTail(), asyncQueueUnregister(), ClearPendingActionsAndNotifies(), DEBUG1, elog, fb(), LocalChannelTableIsEmpty, pendingActions, pendingNotifies, SignalBackends(), Trace_notify, and tryAdvanceTail.
Referenced by CommitTransaction().
Definition at line 1152 of file async.c.
References ereport, errcode(), errmsg(), ERROR, fb(), pendingActions, and pendingNotifies.
Referenced by PrepareTransaction().
Definition at line 2500 of file async.c.
References fb(), GetCurrentTransactionNestLevel(), ActionList::nestingLevel, NotificationList::nestingLevel, pendingActions, pendingNotifies, pfree(), ActionList::upper, and NotificationList::upper.
Referenced by AbortSubTransaction().
Definition at line 2430 of file async.c.
References ActionList::actions, AddEventToPendingNotifies(), Assert, AsyncExistsPendingNotify(), fb(), GetCurrentTransactionNestLevel(), lfirst, list_concat(), ActionList::nestingLevel, NotificationList::nestingLevel, pendingActions, pendingNotifies, pfree(), ActionList::upper, and NotificationList::upper.
Referenced by CommitSubTransaction().
Definition at line 1422 of file async.c.
References amRegisteredListener, Async_UnlistenOnExit(), asyncQueueReadAllNotifications(), before_shmem_exit(), DEBUG1, elog, fb(), i, INVALID_PROC_NUMBER, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), MyDatabaseId, MyProcNumber, MyProcPid, QUEUE_BACKEND_DBOID, QUEUE_BACKEND_IS_ADVANCING, QUEUE_BACKEND_PID, QUEUE_BACKEND_POS, QUEUE_BACKEND_WAKEUP_PENDING, QUEUE_FIRST_LISTENER, QUEUE_HEAD, QUEUE_NEXT_LISTENER, QUEUE_POS_EQUAL, QUEUE_POS_MAX, QUEUE_TAIL, Trace_notify, and unlistenExitRegistered.
Referenced by PreCommit_Notify().
Definition at line 3290 of file async.c.
References check_slru_buffers(), and newval.
Definition at line 1838 of file async.c.
References GlobalChannelKey::dboid, DEBUG1, dsa_free(), dsa_get_address(), dshash_delete_current(), dshash_seq_init(), dshash_seq_next(), dshash_seq_term(), elog, fb(), globalChannelDSA, globalChannelTable, hash_destroy(), i, GlobalChannelEntry::key, GlobalChannelEntry::listenersArray, localChannelTable, MyDatabaseId, MyProcNumber, MyProcPid, GlobalChannelEntry::numListeners, and Trace_notify.
Referenced by Async_UnlistenOnExit().
Definition at line 3272 of file async.c.
References fb(), pendingActions, pendingListenActions, and pendingNotifies.
Referenced by AtAbort_Notify(), and AtCommit_Notify().
|
inlinestatic |
Definition at line 638 of file async.c.
References fb(), NAMEDATALEN, and strlcpy().
Referenced by ApplyPendingListenActions(), PrepareTableEntriesForListen(), and SignalBackends().
Definition at line 650 of file async.c.
References GlobalChannelKey::channel, DatumGetUInt32(), GlobalChannelKey::dboid, fb(), hash_any(), hash_uint32(), and NAMEDATALEN.
Definition at line 2543 of file async.c.
References MyLatch, notifyInterruptPending, and SetLatch().
Referenced by procsignal_sigusr1_handler().
Definition at line 677 of file async.c.
References asyncQueueControl, dsa_attach(), dsa_create, dsa_get_handle(), dsa_pin(), dsa_pin_mapping(), dshash_attach(), dshash_create(), dshash_get_hash_table_handle(), DSHASH_HANDLE_INVALID, fb(), globalChannelDSA, globalChannelTable, AsyncQueueControl::globalChannelTableDSA, AsyncQueueControl::globalChannelTableDSH, globalChannelTableDSHParams, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), MemoryContextSwitchTo(), and TopMemoryContext.
Referenced by PreCommit_Notify().
Definition at line 728 of file async.c.
References fb(), hash_create(), HASH_ELEM, HASH_STRINGS, HASHCTL::keysize, localChannelTable, and NAMEDATALEN.
Referenced by PreCommit_Notify().
Definition at line 754 of file async.c.
References ActionList::actions, CurTransactionContext, fb(), HASH_CONTEXT, hash_create(), HASH_ELEM, HASH_STRINGS, HASHCTL::keysize, list_length(), NAMEDATALEN, pendingActions, and pendingListenActions.
Referenced by PreCommit_Notify().
Definition at line 1895 of file async.c.
References fb(), HASH_FIND, hash_search(), and localChannelTable.
Referenced by asyncQueueProcessPageEntries().
Definition at line 3242 of file async.c.
References Assert, Notification::channel_len, Notification::data, DatumGetUInt32(), hash_any(), and Notification::payload_len.
Referenced by AddEventToPendingNotifies().
Definition at line 3256 of file async.c.
Referenced by AddEventToPendingNotifies().
Definition at line 3093 of file async.c.
References buf, DestRemote, elog, INFO, pq_beginmessage(), pq_endmessage(), pq_sendint32(), pq_sendstring(), PqMsg_NotificationResponse, and whereToSendOutput.
Referenced by asyncQueueProcessPageEntries(), and ProcessParallelMessage().
| Datum pg_listening_channels | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1087 of file async.c.
References ChannelName::channel, CStringGetTextDatum, fb(), hash_seq_init(), hash_seq_search(), localChannelTable, MemoryContextSwitchTo(), palloc(), SRF_FIRSTCALL_INIT, SRF_IS_FIRSTCALL, SRF_PERCALL_SETUP, SRF_RETURN_DONE, and SRF_RETURN_NEXT.
| Datum pg_notification_queue_usage | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2161 of file async.c.
References asyncQueueAdvanceTail(), asyncQueueUsage(), fb(), LW_SHARED, LWLockAcquire(), LWLockRelease(), PG_RETURN_FLOAT8, and usage().
| Datum pg_notify | ( | PG_FUNCTION_ARGS | ) |
Definition at line 852 of file async.c.
References Async_Notify(), PG_ARGISNULL, PG_GETARG_TEXT_PP, PG_RETURN_VOID, PreventCommandDuringRecovery(), and text_to_cstring().
Definition at line 1177 of file async.c.
References AccessExclusiveLock, ActionList::actions, asyncQueueAddEntries(), asyncQueueFillWarning(), asyncQueueIsFull(), BecomeRegisteredListener(), DEBUG1, elog, ereport, errcode(), errmsg(), ERROR, NotificationList::events, fb(), foreach_ptr, GetCurrentTransactionId(), hash_seq_init(), hash_seq_search(), initGlobalChannelTable(), initLocalChannelTable(), initPendingListenActions(), InvalidOid, lappend(), lfirst, list_head(), LISTEN_LISTEN, LISTEN_UNLISTEN, LISTEN_UNLISTEN_ALL, LockSharedObject(), LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), MaxBackends, MemoryContextAlloc(), NIL, pendingActions, pendingNotifies, PrepareTableEntriesForListen(), PrepareTableEntriesForUnlisten(), PrepareTableEntriesForUnlistenAll(), QUEUE_HEAD, queueHeadAfterWrite, queueHeadBeforeWrite, SET_QUEUE_POS, signalPids, signalProcnos, TopMemoryContext, Trace_notify, NotificationList::uniqueChannelHash, and NotificationList::uniqueChannelNames.
Referenced by CommitTransaction().
Definition at line 1523 of file async.c.
References PendingListenEntry::action, GlobalChannelEntry::allocatedListeners, dsa_allocate, dsa_free(), dsa_get_address(), DsaPointerIsValid, dshash_find_or_insert(), dshash_release_lock(), fb(), globalChannelDSA, GlobalChannelKeyInit(), globalChannelTable, HASH_ENTER, hash_search(), i, INITIAL_LISTENERS_ARRAY_SIZE, InvalidDsaPointer, GlobalChannelEntry::listenersArray, localChannelTable, MyDatabaseId, MyProcNumber, GlobalChannelEntry::numListeners, PENDING_LISTEN, and pendingListenActions.
Referenced by PreCommit_Notify().
Definition at line 1626 of file async.c.
References PendingListenEntry::action, Assert, fb(), HASH_ENTER, HASH_FIND, hash_search(), localChannelTable, PENDING_UNLISTEN, and pendingListenActions.
Referenced by PreCommit_Notify().
Definition at line 1656 of file async.c.
References PendingListenEntry::action, fb(), HASH_ENTER, hash_search(), hash_seq_init(), hash_seq_search(), localChannelTable, PENDING_UNLISTEN, and pendingListenActions.
Referenced by PreCommit_Notify().
Definition at line 3052 of file async.c.
References asyncQueueReadAllNotifications(), CommitTransactionCommand(), DEBUG1, elog, LocalChannelTableIsEmpty, notifyInterruptPending, pq_flush, set_ps_display(), StartTransactionCommand(), and Trace_notify.
Referenced by ProcessNotifyInterrupt().
Definition at line 2573 of file async.c.
References IsTransactionOrTransactionBlock(), notifyInterruptPending, and ProcessIncomingNotify().
Referenced by PostgresMain(), and ProcessClientReadInterrupt().
|
static |
Definition at line 988 of file async.c.
References ActionList::actions, CurTransactionContext, fb(), GetCurrentTransactionNestLevel(), lappend(), list_make1, MemoryContextAlloc(), MemoryContextSwitchTo(), ActionList::nestingLevel, palloc(), pendingActions, TopTransactionContext, and ActionList::upper.
Referenced by Async_Listen(), Async_Unlisten(), and Async_UnlistenAll().
|
static |
Definition at line 1686 of file async.c.
References dsa_free(), dshash_delete_entry(), fb(), globalChannelDSA, globalChannelTable, idx(), GlobalChannelEntry::listenersArray, and GlobalChannelEntry::numListeners.
Referenced by ApplyPendingListenActions().
Definition at line 2259 of file async.c.
References Assert, asyncQueuePageDiff(), DEBUG3, dsa_get_address(), dshash_find(), dshash_release_lock(), elog, fb(), foreach_ptr, globalChannelDSA, GlobalChannelKeyInit(), globalChannelTable, i, INVALID_PROC_NUMBER, InvalidPid, j, GlobalChannelEntry::listenersArray, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), MyDatabaseId, MyProcPid, notifyInterruptPending, GlobalChannelEntry::numListeners, pendingNotifies, PROCSIG_NOTIFY_INTERRUPT, QUEUE_BACKEND_IS_ADVANCING, QUEUE_BACKEND_PID, QUEUE_BACKEND_POS, QUEUE_BACKEND_WAKEUP_PENDING, QUEUE_CLEANUP_DELAY, QUEUE_FIRST_LISTENER, QUEUE_HEAD, QUEUE_NEXT_LISTENER, QUEUE_POS_EQUAL, QUEUE_POS_PAGE, QUEUE_POS_PRECEDES, queueHeadAfterWrite, queueHeadBeforeWrite, SendProcSignal(), signalPids, signalProcnos, and NotificationList::uniqueChannelNames.
Referenced by AtCommit_Notify().
Definition at line 544 of file async.c.
Referenced by asyncQueueUnregister(), AtAbort_Notify(), AtCommit_Notify(), and BecomeRegisteredListener().
|
static |
Definition at line 346 of file async.c.
Referenced by asyncQueueFillWarning(), AsyncShmemInit(), and initGlobalChannelTable().
Definition at line 401 of file async.c.
Referenced by ApplyPendingListenActions(), CleanupListenersOnExit(), initGlobalChannelTable(), PrepareTableEntriesForListen(), RemoveListenerFromChannel(), and SignalBackends().
|
static |
Definition at line 400 of file async.c.
Referenced by ApplyPendingListenActions(), CleanupListenersOnExit(), initGlobalChannelTable(), PrepareTableEntriesForListen(), RemoveListenerFromChannel(), and SignalBackends().
|
static |
Definition at line 663 of file async.c.
Referenced by initGlobalChannelTable().
Definition at line 408 of file async.c.
Referenced by ApplyPendingListenActions(), CleanupListenersOnExit(), initLocalChannelTable(), IsListeningOn(), pg_listening_channels(), PrepareTableEntriesForListen(), PrepareTableEntriesForUnlisten(), and PrepareTableEntriesForUnlistenAll().
| int max_notify_queue_pages = 1048576 |
Definition at line 570 of file async.c.
Referenced by asyncQueueIsFull(), and asyncQueueUsage().
|
static |
| volatile sig_atomic_t notifyInterruptPending = false |
Definition at line 538 of file async.c.
Referenced by HandleNotifyInterrupt(), PostgresMain(), ProcessClientReadInterrupt(), ProcessIncomingNotify(), ProcessNotifyInterrupt(), and SignalBackends().
|
static |
Definition at line 444 of file async.c.
Referenced by Async_Unlisten(), Async_UnlistenAll(), AtCommit_Notify(), AtPrepare_Notify(), AtSubAbort_Notify(), AtSubCommit_Notify(), ClearPendingActionsAndNotifies(), initPendingListenActions(), PreCommit_Notify(), and queue_listen().
Definition at line 466 of file async.c.
Referenced by ApplyPendingListenActions(), ClearPendingActionsAndNotifies(), initPendingListenActions(), PrepareTableEntriesForListen(), PrepareTableEntriesForUnlisten(), and PrepareTableEntriesForUnlistenAll().
|
static |
Definition at line 520 of file async.c.
Referenced by AddEventToPendingNotifies(), Async_Notify(), AsyncExistsPendingNotify(), asyncQueueAddEntries(), AtCommit_Notify(), AtPrepare_Notify(), AtSubAbort_Notify(), AtSubCommit_Notify(), ClearPendingActionsAndNotifies(), PreCommit_Notify(), and SignalBackends().
|
static |
Definition at line 553 of file async.c.
Referenced by PreCommit_Notify(), and SignalBackends().
|
static |
Definition at line 552 of file async.c.
Referenced by PreCommit_Notify(), and SignalBackends().
Definition at line 560 of file async.c.
Referenced by PreCommit_Notify(), and SignalBackends().
|
static |
Definition at line 561 of file async.c.
Referenced by PreCommit_Notify(), and SignalBackends().
Definition at line 567 of file async.c.
Referenced by Async_Listen(), Async_Notify(), Async_Unlisten(), Async_UnlistenAll(), AtCommit_Notify(), BecomeRegisteredListener(), CleanupListenersOnExit(), PreCommit_Notify(), and ProcessIncomingNotify().
Definition at line 564 of file async.c.
Referenced by asyncQueueAddEntries(), and AtCommit_Notify().
Definition at line 541 of file async.c.
Referenced by Async_Unlisten(), Async_UnlistenAll(), and BecomeRegisteredListener().