|
PostgreSQL Source Code git master
|
#include "postgres.h"#include <signal.h>#include <unistd.h>#include "miscadmin.h"#include "storage/ipc.h"#include "storage/proc.h"#include "storage/procnumber.h"#include "storage/procsignal.h"#include "storage/shmem.h"#include "storage/sinvaladt.h"#include "storage/spin.h"
Go to the source code of this file.
Data Structures | |
| struct | ProcState |
| struct | SISeg |
Macros | |
| #define | MAXNUMMESSAGES 4096 |
| #define | MSGNUMWRAPAROUND (MAXNUMMESSAGES * 262144) |
| #define | CLEANUP_MIN (MAXNUMMESSAGES / 2) |
| #define | CLEANUP_QUANTUM (MAXNUMMESSAGES / 16) |
| #define | SIG_THRESHOLD (MAXNUMMESSAGES / 2) |
| #define | WRITE_QUANTUM 64 |
| #define | NumProcStateSlots (MaxBackends + NUM_AUXILIARY_PROCS) |
Typedefs | |
| typedef struct ProcState | ProcState |
| typedef struct SISeg | SISeg |
Variables | |
| static SISeg * | shmInvalBuffer |
| static LocalTransactionId | nextLocalTransactionId |
| #define CLEANUP_MIN (MAXNUMMESSAGES / 2) |
Definition at line 131 of file sinvaladt.c.
| #define CLEANUP_QUANTUM (MAXNUMMESSAGES / 16) |
Definition at line 132 of file sinvaladt.c.
| #define MAXNUMMESSAGES 4096 |
Definition at line 129 of file sinvaladt.c.
| #define MSGNUMWRAPAROUND (MAXNUMMESSAGES * 262144) |
Definition at line 130 of file sinvaladt.c.
| #define NumProcStateSlots (MaxBackends + NUM_AUXILIARY_PROCS) |
Definition at line 204 of file sinvaladt.c.
| #define SIG_THRESHOLD (MAXNUMMESSAGES / 2) |
Definition at line 133 of file sinvaladt.c.
| #define WRITE_QUANTUM 64 |
Definition at line 134 of file sinvaladt.c.
Definition at line 328 of file sinvaladt.c.
References arg, Assert, DatumGetPointer(), elog, fb(), i, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), MyProcNumber, nextLocalTransactionId, and PANIC.
Referenced by SharedInvalBackendInit().
| LocalTransactionId GetNextLocalTransactionId | ( | void | ) |
Definition at line 701 of file sinvaladt.c.
References LocalTransactionIdIsValid, and nextLocalTransactionId.
Referenced by InitRecoveryTransactionEnvironment(), and StartTransaction().
Definition at line 272 of file sinvaladt.c.
References CleanupInvalidationState(), elog, ERROR, fb(), LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), MyProcNumber, MyProcPid, nextLocalTransactionId, SISeg::numProcs, NumProcStateSlots, on_shmem_exit(), PANIC, SISeg::pgprocnos, PointerGetDatum(), and shmInvalBuffer.
Referenced by InitPostgres(), and InitRecoveryTransactionEnvironment().
Definition at line 234 of file sinvaladt.c.
References CLEANUP_MIN, ProcState::hasMessages, i, InvalidLocalTransactionId, SISeg::maxMsgNum, SISeg::minMsgNum, SISeg::msgnumLock, ProcState::nextLXID, ProcState::nextMsgNum, SISeg::nextThreshold, SISeg::numProcs, NumProcStateSlots, SISeg::pgprocnos, ProcState::procPid, SISeg::procState, ProcState::resetState, SharedInvalShmemSize(), ShmemInitStruct(), shmInvalBuffer, ProcState::signaled, and SpinLockInit.
Referenced by CreateOrAttachShmemStructs().
Definition at line 218 of file sinvaladt.c.
References add_size(), fb(), mul_size(), and NumProcStateSlots.
Referenced by CalculateShmemSize(), and SharedInvalShmemInit().
Definition at line 577 of file sinvaladt.c.
References Assert, CLEANUP_MIN, CLEANUP_QUANTUM, DEBUG4, elog, fb(), i, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), MAXNUMMESSAGES, MSGNUMWRAPAROUND, ProcState::nextMsgNum, PROCSIG_CATCHUP_INTERRUPT, SendProcSignal(), shmInvalBuffer, and SIG_THRESHOLD.
Referenced by ReceiveSharedInvalidMessages(), and SIInsertDataEntries().
| int SIGetDataEntries | ( | SharedInvalidationMessage * | data, |
| int | datasize | ||
| ) |
Definition at line 473 of file sinvaladt.c.
References data, fb(), LW_SHARED, LWLockAcquire(), LWLockRelease(), MAXNUMMESSAGES, MyProcNumber, SISeg::procState, shmInvalBuffer, SpinLockAcquire, and SpinLockRelease.
Referenced by ReceiveSharedInvalidMessages().
| void SIInsertDataEntries | ( | const SharedInvalidationMessage * | data, |
| int | n | ||
| ) |
Definition at line 370 of file sinvaladt.c.
References data, fb(), ProcState::hasMessages, i, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), MAXNUMMESSAGES, Min, shmInvalBuffer, SICleanupQueue(), SpinLockAcquire, SpinLockRelease, and WRITE_QUANTUM.
Referenced by SendSharedInvalidMessages().
|
static |
Definition at line 209 of file sinvaladt.c.
Referenced by CleanupInvalidationState(), GetNextLocalTransactionId(), and SharedInvalBackendInit().
|
static |
Definition at line 206 of file sinvaladt.c.
Referenced by SharedInvalBackendInit(), SharedInvalShmemInit(), SICleanupQueue(), SIGetDataEntries(), and SIInsertDataEntries().