|
PostgreSQL Source Code git master
|
#include "postgres.h"#include "access/table.h"#include "access/xlog_internal.h"#include "access/xlogutils.h"#include "access/xlogwait.h"#include "commands/repack.h"#include "commands/repack_internal.h"#include "libpq/pqmq.h"#include "replication/snapbuild.h"#include "storage/ipc.h"#include "storage/proc.h"#include "tcop/tcopprot.h"#include "utils/memutils.h"
Go to the source code of this file.
Macros | |
| #define | REPL_PLUGIN_NAME "pgrepack" |
Functions | |
| static void | RepackWorkerShutdown (int code, Datum arg) |
| static LogicalDecodingContext * | repack_setup_logical_decoding (Oid relid) |
| static void | repack_cleanup_logical_decoding (LogicalDecodingContext *ctx) |
| static void | export_initial_snapshot (Snapshot snapshot, DecodingWorkerShared *shared) |
| static bool | decode_concurrent_changes (LogicalDecodingContext *ctx, DecodingWorkerShared *shared) |
| void | RepackWorkerMain (Datum main_arg) |
| bool | AmRepackWorker (void) |
| bool | change_useless_for_repack (XLogRecordBuffer *buf) |
Variables | |
| static bool | am_repack_worker = false |
| static XLogSegNo | repack_current_segment = 0 |
| static RelFileLocator | repacked_rel_locator = {.relNumber = InvalidOid} |
| static RelFileLocator | repacked_rel_toast_locator = {.relNumber = InvalidOid} |
| #define REPL_PLUGIN_NAME "pgrepack" |
Definition at line 31 of file repack_worker.c.
Definition at line 183 of file repack_worker.c.
References am_repack_worker.
Referenced by mq_putmessage().
| bool change_useless_for_repack | ( | XLogRecordBuffer * | buf | ) |
Definition at line 497 of file repack_worker.c.
References Assert, buf, fb(), OidIsValid, XLogReaderState::record, RelFileLocatorEquals, RelFileLocator::relNumber, repacked_rel_locator, repacked_rel_toast_locator, and XLogRecGetBlockTagExtended().
Referenced by heap2_decode(), and heap_decode().
|
static |
Definition at line 361 of file repack_worker.c.
References BufFileClose(), BufFileCreateFileSet(), CHECK_FOR_INTERRUPTS, ConditionVariableSignal(), DecodingWorkerShared::cv, DEBUG1, DecodingWorkerFileName(), DecodingWorkerShared::done, elog, ReadLocalXLogPageNoWaitPrivate::end_of_wal, XLogReaderState::EndRecPtr, ereport, errmsg, ERROR, fb(), SharedFileSet::fs, InvalidXLogRecPtr, DecodingWorkerShared::last_exported, LogicalConfirmReceivedLocation(), LogicalDecodingProcessRecord(), DecodingWorkerShared::lsn_upto, MAXPGPATH, DecodingWorkerShared::mutex, LogicalDecodingContext::output_writer_private, XLogReaderState::private_data, LogicalDecodingContext::reader, DecodingWorkerShared::relid, repack_current_segment, DecodingWorkerShared::sfs, SpinLockAcquire(), SpinLockRelease(), WAIT_LSN_RESULT_SUCCESS, WAIT_LSN_RESULT_TIMEOUT, WAIT_LSN_TYPE_PRIMARY_FLUSH, WaitForLSN(), wal_segment_size, XLByteToSeg, XLogReadRecord(), and XLogRecPtrIsValid.
Referenced by RepackWorkerMain().
|
static |
Definition at line 329 of file repack_worker.c.
References BufFileClose(), BufFileCreateFileSet(), BufFileWrite(), ConditionVariableSignal(), DecodingWorkerShared::cv, DecodingWorkerFileName(), EstimateSnapshotSpace(), fb(), SharedFileSet::fs, DecodingWorkerShared::last_exported, MAXPGPATH, DecodingWorkerShared::mutex, palloc(), pfree(), DecodingWorkerShared::relid, SerializeSnapshot(), DecodingWorkerShared::sfs, SpinLockAcquire(), and SpinLockRelease().
Referenced by RepackWorkerMain().
|
static |
Definition at line 313 of file repack_worker.c.
References ExecDropSingleTupleTableSlot(), fb(), FreeDecodingContext(), LogicalDecodingContext::output_writer_private, and ReplicationSlotDropAcquired().
Referenced by RepackWorkerMain().
|
static |
Definition at line 196 of file repack_worker.c.
References AccessShareLock, ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate, Assert, CheckLogicalDecodingRequirements(), CheckSlotPermissions(), LogicalDecodingContext::context, CreateInitDecodingContext(), CurrentMemoryContext, CurrentResourceOwner, DecodingContextFindStartpoint(), XLogReaderState::EndRecPtr, EnsureLogicalDecodingEnabled(), LogicalDecodingContext::fast_forward, fb(), GetTopTransactionIdIfAny(), InvalidXLogRecPtr, MemoryContextSwitchTo(), MyProcPid, NAMEDATALEN, NameStr, NIL, OidIsValid, LogicalDecodingContext::output_writer_private, XLogReaderRoutine::page_read, palloc0_object, XLogReaderState::private_data, RelationData::rd_locator, RelationData::rd_rel, read_local_xlog_page(), read_local_xlog_page_no_wait(), LogicalDecodingContext::reader, repack_current_segment, repacked_rel_locator, repacked_rel_toast_locator, REPL_PLUGIN_NAME, ReplicationSlotCreate(), XLogReaderState::routine, RS_TEMPORARY, snprintf, table_close(), table_open(), TransactionIdIsValid, wal_segment_close(), wal_segment_open(), wal_segment_size, XL_ROUTINE, and XLByteToSeg.
Referenced by RepackWorkerMain().
Definition at line 57 of file repack_worker.c.
References am_repack_worker, Assert, DecodingWorkerShared::backend_pid, DecodingWorkerShared::backend_proc, DecodingWorkerShared::backend_proc_number, BackgroundWorkerInitializeConnectionByOid(), BackgroundWorkerUnblockSignals(), BecomeLockGroupMember(), before_shmem_exit(), BUFFERALIGN, CommitTransactionCommand(), ConditionVariableSignal(), DecodingWorkerShared::cv, DatumGetUInt32(), DecodingWorkerShared::dbid, decode_concurrent_changes(), die, dsm_attach(), DecodingWorkerShared::dsm_seg, dsm_segment_address(), ereport, errcode(), errmsg, ERROR, DecodingWorkerShared::error_queue, export_initial_snapshot(), fb(), DecodingWorkerShared::initialized, InvalidateCatalogSnapshot(), DecodingWorkerShared::lsn_upto, DecodingWorkerShared::mutex, MyProc, PointerGetDatum(), pq_redirect_to_shm_mq(), pq_set_parallel_leader(), pqsignal, DecodingWorkerShared::relid, repack_cleanup_logical_decoding(), repack_setup_logical_decoding(), RepackWorkerShutdown(), DecodingWorkerShared::roleid, DecodingWorkerShared::sfs, SharedFileSetAttach(), shm_mq_attach(), shm_mq_set_sender(), SnapBuildInitialSnapshot(), SpinLockAcquire(), SpinLockRelease(), StartTransactionCommand(), XACT_REPEATABLE_READ, XactIsoLevel, XactReadOnly, and XLogRecPtrIsValid.
Definition at line 171 of file repack_worker.c.
References arg, DecodingWorkerShared::backend_pid, DecodingWorkerShared::backend_proc_number, DatumGetPointer(), dsm_detach(), DecodingWorkerShared::dsm_seg, PROCSIG_REPACK_MESSAGE, and SendProcSignal().
Referenced by RepackWorkerMain().
Definition at line 42 of file repack_worker.c.
Referenced by AmRepackWorker(), and RepackWorkerMain().
|
static |
Definition at line 45 of file repack_worker.c.
Referenced by decode_concurrent_changes(), and repack_setup_logical_decoding().
|
static |
Definition at line 51 of file repack_worker.c.
Referenced by change_useless_for_repack(), and repack_setup_logical_decoding().
|
static |
Definition at line 52 of file repack_worker.c.
Referenced by change_useless_for_repack(), and repack_setup_logical_decoding().