|
PostgreSQL Source Code git master
|
#include "postgres.h"#include "access/amapi.h"#include "access/heapam.h"#include "access/multixact.h"#include "access/relscan.h"#include "access/tableam.h"#include "access/toast_internals.h"#include "access/transam.h"#include "access/xact.h"#include "catalog/catalog.h"#include "catalog/dependency.h"#include "catalog/heap.h"#include "catalog/index.h"#include "catalog/namespace.h"#include "catalog/objectaccess.h"#include "catalog/pg_am.h"#include "catalog/pg_constraint.h"#include "catalog/pg_inherits.h"#include "catalog/toasting.h"#include "commands/defrem.h"#include "commands/progress.h"#include "commands/repack.h"#include "commands/repack_internal.h"#include "commands/tablecmds.h"#include "commands/vacuum.h"#include "executor/executor.h"#include "libpq/pqformat.h"#include "libpq/pqmq.h"#include "miscadmin.h"#include "optimizer/optimizer.h"#include "pgstat.h"#include "storage/bufmgr.h"#include "storage/lmgr.h"#include "storage/predicate.h"#include "storage/proc.h"#include "utils/acl.h"#include "utils/fmgroids.h"#include "utils/guc.h"#include "utils/injection_point.h"#include "utils/inval.h"#include "utils/lsyscache.h"#include "utils/memutils.h"#include "utils/pg_rusage.h"#include "utils/relmapper.h"#include "utils/snapmgr.h"#include "utils/syscache.h"#include "utils/wait_event_types.h"
Go to the source code of this file.
Data Structures | |
| struct | RelToCluster |
| struct | ChangeContext |
| struct | DecodingWorker |
Macros | |
| #define | WORKER_FILE_SNAPSHOT 0 |
Typedefs | |
| typedef struct ChangeContext | ChangeContext |
| typedef struct DecodingWorker | DecodingWorker |
Variables | |
| static DecodingWorker * | decoding_worker = NULL |
| volatile sig_atomic_t | RepackMessagePending = false |
| typedef struct ChangeContext ChangeContext |
| typedef struct DecodingWorker DecodingWorker |
|
static |
Definition at line 2752 of file repack.c.
References CompactAttribute::attisdropped, CompactAttribute::attlen, DatumGetPointer(), fb(), i, TupleDescData::natts, slot_attisnull(), slot_getsomeattrs(), TupleTableSlot::tts_values, TupleDescCompactAttr(), and VARATT_IS_EXTERNAL_ONDISK().
Referenced by apply_concurrent_changes().
|
static |
Definition at line 2459 of file repack.c.
References adjust_toast_pointers(), apply_concurrent_delete(), apply_concurrent_insert(), apply_concurrent_update(), BufFileReadMaybeEOF(), CHANGE_DELETE, CHANGE_INSERT, CHANGE_UPDATE_NEW, CHANGE_UPDATE_OLD, CHECK_FOR_INTERRUPTS, CommandCounterIncrement(), elog, ERROR, ExecClearTuple(), ExecDropSingleTupleTableSlot(), fb(), find_target_tuple(), GetPerTupleMemoryContext, MakeSingleTupleTableSlot(), MemoryContextSwitchTo(), RelationGetDescr, ResetPerTupleExprContext, restore_tuple(), table_slot_callbacks(), TTSOpsVirtual, and UpdateActiveSnapshotCommandId().
Referenced by process_concurrent_changes().
|
static |
Definition at line 2646 of file repack.c.
References ereport, errmsg, ERROR, GetCurrentCommandId(), InvalidSnapshot, pgstat_progress_incr_param(), PROGRESS_REPACK_HEAP_TUPLES_DELETED, TABLE_DELETE_NO_LOGICAL, table_tuple_delete(), TM_Ok, and TupleTableSlot::tts_tid.
Referenced by apply_concurrent_changes().
|
static |
Definition at line 2585 of file repack.c.
References ExecInsertIndexTuples(), fb(), GetCurrentCommandId(), NIL, pgstat_progress_incr_param(), PROGRESS_REPACK_HEAP_TUPLES_INSERTED, TABLE_INSERT_NO_LOGICAL, and table_tuple_insert().
Referenced by apply_concurrent_changes().
|
static |
Definition at line 2606 of file repack.c.
References EIIT_IS_UPDATE, EIIT_ONLY_SUMMARIZING, ereport, errmsg, ERROR, ExecInsertIndexTuples(), fb(), GetCurrentCommandId(), InvalidSnapshot, NIL, pgstat_progress_incr_param(), PROGRESS_REPACK_HEAP_TUPLES_UPDATED, table_tuple_update(), TABLE_UPDATE_NO_LOGICAL, TM_Ok, TU_None, and TU_Summarizing.
Referenced by apply_concurrent_changes().
Definition at line 3192 of file repack.c.
References ChooseRelationName(), copy_index_constraints(), fb(), foreach_oid, get_rel_name(), get_rel_namespace(), index_close(), index_create_copy(), INDEX_CREATE_SUPPRESS_PROGRESS, index_open(), lappend_oid(), NIL, NoLock, pgstat_progress_update_param(), PROGRESS_REPACK_PHASE, PROGRESS_REPACK_PHASE_REBUILD_INDEX, RelationGetRelid, result, and ShareUpdateExclusiveLock.
Referenced by rebuild_relation_finish_concurrent().
Definition at line 877 of file repack.c.
References ereport, errcode(), errhint(), errmsg, ERROR, fb(), IsCatalogRelation(), IsToastRelation(), OidIsValid, RelationData::rd_pkindex, RelationData::rd_rel, RelationGetRelationName, and RelationGetReplicaIndex().
Referenced by cluster_rel().
Definition at line 751 of file repack.c.
References ereport, errcode(), errmsg, ERROR, fb(), heap_attisnull(), index_close(), index_open(), NoLock, RelationGetRelationName, and RelationGetRelid.
Referenced by ATExecClusterOn(), cluster_rel(), ExecRepack(), and process_single_relation().
| void cluster_rel | ( | RepackCommand | cmd, |
| Relation | OldHeap, | ||
| Oid | indexOid, | ||
| ClusterParams * | params, | ||
| bool | isTopLevel | ||
| ) |
Definition at line 502 of file repack.c.
References allowSystemTableMods, Assert, AtEOXact_GUC(), check_concurrent_repack_requirements(), CHECK_FOR_INTERRUPTS, check_index_is_clusterable(), CheckTableNotInUse(), CLUOPT_CONCURRENT, CLUOPT_RECHECK, CLUOPT_VERBOSE, cluster_rel_recheck(), ereport, errcode(), errdetail(), errmsg, ERROR, fb(), GetUserIdAndSecContext(), index_close(), index_open(), InvalidOid, IsCatalogRelation(), NewGUCNestLevel(), NoLock, OidIsValid, ClusterParams::options, PG_END_TRY, PG_FINALLY, PG_TRY, pgstat_progress_end_command(), pgstat_progress_start_command(), pgstat_progress_update_param(), PROGRESS_COMMAND_REPACK, PROGRESS_REPACK_COMMAND, rebuild_relation(), relation_close(), RELATION_IS_OTHER_TEMP, RelationGetRelationName, RelationGetRelid, RelationIsPopulated, REPACK_COMMAND_CLUSTER, RepackCommandAsString(), RepackLockLevel(), RestrictSearchPath(), SECURITY_RESTRICTED_OPERATION, SetUserIdAndSecContext(), stop_repack_decoding_worker(), TransferPredicateLocksToHeapRelation(), and verbose.
Referenced by ExecRepack(), process_single_relation(), and vacuum_rel().
|
static |
Definition at line 690 of file repack.c.
References CLUOPT_RECHECK_ISCLUSTERED, fb(), get_index_isclustered(), ObjectIdGetDatum(), OidIsValid, relation_close(), RELATION_IS_OTHER_TEMP, RelationGetRelid, repack_is_permitted_for_relation(), and SearchSysCacheExists1.
Referenced by cluster_rel().
Definition at line 3237 of file repack.c.
References BTEqualStrategyNumber, CatalogTupleInsert(), CommandCounterIncrement(), DEPENDENCY_AUTO, fb(), Form_pg_constraint, GetNewOidWithIndex(), GETSTRUCT(), heap_modify_tuple(), HeapTupleIsValid, ObjectAddressSet, ObjectIdGetDatum(), recordDependencyOn(), RelationGetDescr, RelationGetRelid, RowExclusiveLock, ScanKeyInit(), systable_beginscan(), systable_endscan(), systable_getnext(), table_close(), table_open(), and values.
Referenced by build_new_indexes().
|
static |
Definition at line 1237 of file repack.c.
References Assert, CacheInvalidateRelcacheByTuple(), CatalogTupleUpdate(), CommandCounterIncrement(), DEBUG2, elog, ereport, errdetail(), errmsg, ERROR, fb(), VacuumCutoffs::FreezeLimit, get_namespace_name(), GETSTRUCT(), heap_freetuple(), HeapTupleIsValid, INFO, InvalidOid, LockRelationOid(), VacuumCutoffs::MultiXactCutoff, MultiXactIdIsValid, MultiXactIdPrecedes(), ObjectIdGetDatum(), VacuumCutoffs::OldestXmin, pg_rusage_init(), pg_rusage_show(), PG_USED_FOR_ASSERTS_ONLY, plan_cluster_use_sort(), RelationGetDescr, RelationGetNamespace, RelationGetNumberOfBlocks, RelationGetRelationName, RelationGetRelid, VacuumCutoffs::relfrozenxid, VacuumCutoffs::relminmxid, RepackLockLevel(), RowExclusiveLock, SearchSysCacheCopy1, table_close(), table_open(), table_relation_copy_for_cluster(), TransactionIdIsValid, TransactionIdPrecedes(), vacuum_get_cutoffs(), and verbose.
Referenced by rebuild_relation().
Definition at line 3494 of file repack.c.
References fb(), MAXPGPATH, and snprintf.
Referenced by decode_concurrent_changes(), export_initial_snapshot(), get_initial_snapshot(), and process_concurrent_changes().
|
static |
Definition at line 2398 of file repack.c.
References ereport, errcode(), errmsg, ERROR, fb(), foreach_oid, get_index_isclustered(), get_relname_relid(), InvalidOid, OidIsValid, RelationData::rd_rel, RelationGetIndexList(), and RelationGetRelationName.
Referenced by ExecRepack(), and process_single_relation().
| void ExecRepack | ( | ParseState * | pstate, |
| RepackStmt * | stmt, | ||
| bool | isTopLevel | ||
| ) |
Definition at line 237 of file repack.c.
References AccessExclusiveLock, ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate, Assert, check_index_is_clusterable(), CLUOPT_ANALYZE, CLUOPT_CONCURRENT, CLUOPT_RECHECK, CLUOPT_RECHECK_ISCLUSTERED, CLUOPT_VERBOSE, cluster_rel(), CommitTransactionCommand(), defGetBoolean(), determine_clustered_index(), elog, ereport, errcode(), errhint(), errmsg, ERROR, fb(), foreach_node, foreach_ptr, get_tables_to_repack(), get_tables_to_repack_partitioned(), GetTransactionSnapshot(), MemoryContextDelete(), OidIsValid, ClusterParams::options, parser_errposition(), PopActiveSnapshot(), PortalContext, PreventInTransactionBlock(), process_single_relation(), PushActiveSnapshot(), RelationData::rd_rel, RelationGetRelationName, RelationGetRelid, REPACK_COMMAND_CLUSTER, REPACK_COMMAND_REPACK, RepackCommandAsString(), RepackLockLevel(), StartTransactionCommand(), stmt, table_close(), and try_table_open().
Referenced by standard_ProcessUtility().
|
static |
Definition at line 2787 of file repack.c.
References Assert, fb(), Form_pg_index, ForwardScanDirection, GetActiveSnapshot(), i, idx(), index_beginscan(), index_endscan(), index_getnext_slot(), index_rescan(), ScanKeyData::sk_argument, TupleTableSlot::tts_isnull, and TupleTableSlot::tts_values.
Referenced by apply_concurrent_changes().
| void finish_heap_swap | ( | Oid | OIDOldHeap, |
| Oid | OIDNewHeap, | ||
| bool | is_system_catalog, | ||
| bool | swap_toast_by_content, | ||
| bool | check_constraints, | ||
| bool | is_internal, | ||
| bool | reindex, | ||
| TransactionId | frozenXid, | ||
| MultiXactId | cutoffMulti, | ||
| char | newrelpersistence | ||
| ) |
Definition at line 1865 of file repack.c.
References AccessExclusiveLock, CacheInvalidateCatalog(), CatalogTupleUpdate(), CommandCounterIncrement(), DROP_RESTRICT, elog, ERROR, fb(), GETSTRUCT(), HeapTupleIsValid, i, NAMEDATALEN, NoLock, ObjectIdGetDatum(), OidIsValid, PERFORM_DELETION_INTERNAL, performDeletion(), pgstat_progress_update_param(), PROGRESS_REPACK_PHASE, PROGRESS_REPACK_PHASE_FINAL_CLEANUP, PROGRESS_REPACK_PHASE_REBUILD_INDEX, PROGRESS_REPACK_PHASE_SWAP_REL_FILES, REINDEX_REL_CHECK_CONSTRAINTS, REINDEX_REL_FORCE_INDEXES_PERMANENT, REINDEX_REL_FORCE_INDEXES_UNLOGGED, REINDEX_REL_SUPPRESS_INDEX_USE, reindex_relation(), relation_close(), RelationClearMissing(), RelationMapRemoveMapping(), RenameRelationInternal(), ResetRelRewrite(), RowExclusiveLock, SearchSysCacheCopy1, snprintf, swap_relation_files(), table_close(), table_open(), and toast_get_valid_index().
Referenced by ATRewriteTables(), rebuild_relation(), rebuild_relation_finish_concurrent(), and refresh_by_heap_swap().
|
static |
Definition at line 3437 of file repack.c.
References BufFileClose(), BufFileOpenFileSet(), BufFileReadExact(), ConditionVariableCancelSleep(), ConditionVariablePrepareToSleep(), ConditionVariableSleep(), DecodingWorkerShared::cv, DecodingWorkerFileName(), dsm_segment_address(), fb(), SharedFileSet::fs, DecodingWorkerShared::last_exported, MAXPGPATH, DecodingWorkerShared::mutex, palloc(), pfree(), DecodingWorkerShared::relid, RestoreSnapshot(), DecodingWorker::seg, DecodingWorkerShared::sfs, SpinLockAcquire(), SpinLockRelease(), and WORKER_FILE_SNAPSHOT.
Referenced by rebuild_relation().
|
static |
Definition at line 2086 of file repack.c.
References AccessShareLock, BoolGetDatum(), BTEqualStrategyNumber, ConditionalLockRelationOid(), fb(), Form_pg_index, ForwardScanDirection, GETSTRUCT(), GetUserId(), heap_getnext(), InvalidOid, lappend(), MemoryContextSwitchTo(), NIL, ObjectIdGetDatum(), palloc_object, relation_close(), repack_is_permitted_for_relation(), ScanKeyInit(), SearchSysCacheExists1, table_beginscan_catalog(), table_endscan(), table_open(), and UnlockRelationOid().
Referenced by ExecRepack().
|
static |
Definition at line 2216 of file repack.c.
References fb(), find_all_inheritors(), foreach_oid, get_rel_relkind(), GetUserId(), IndexGetRelation(), InvalidOid, lappend(), MemoryContextSwitchTo(), NIL, NoLock, palloc_object, and repack_is_permitted_for_relation().
Referenced by ExecRepack().
Definition at line 3508 of file repack.c.
References InterruptPending, MyLatch, RepackMessagePending, and SetLatch().
Referenced by procsignal_sigusr1_handler().
|
static |
Definition at line 2884 of file repack.c.
References BTEqualStrategyNumber, CreateExecutorState(), elog, ERROR, ExecOpenIndices(), fb(), Form_pg_index, get_opcode(), get_opfamily_member(), i, InitResultRelInfo(), OidIsValid, palloc(), palloc_array, ScanKeyInit(), ScanKeyData::sk_collation, and WORKER_FILE_SNAPSHOT.
Referenced by rebuild_relation_finish_concurrent().
| Oid make_new_heap | ( | Oid | OIDOldHeap, |
| Oid | NewTableSpace, | ||
| Oid | NewAccessMethod, | ||
| char | relpersistence, | ||
| LOCKMODE | lockmode | ||
| ) |
Definition at line 1108 of file repack.c.
References Assert, CommandCounterIncrement(), elog, ERROR, fb(), heap_create_with_catalog(), HeapTupleIsValid, InvalidOid, LookupCreationNamespace(), NAMEDATALEN, NewHeapCreateToastTable(), NIL, NoLock, ObjectIdGetDatum(), OidIsValid, ONCOMMIT_NOOP, RelationGetDescr, RelationGetNamespace, RelationIsMapped, ReleaseSysCache(), SearchSysCache1(), snprintf, SysCacheGetAttr(), table_close(), and table_open().
Referenced by ATRewriteTables(), rebuild_relation(), and RefreshMatViewByOid().
Definition at line 811 of file repack.c.
References Assert, CatalogTupleUpdate(), elog, ERROR, fb(), Form_pg_index, get_index_isclustered(), GETSTRUCT(), heap_freetuple(), HeapTupleIsValid, InvalidOid, InvokeObjectPostAlterHookArg, lfirst_oid, ObjectIdGetDatum(), OidIsValid, RelationData::rd_rel, RelationGetIndexList(), RowExclusiveLock, SearchSysCacheCopy1, table_close(), and table_open().
Referenced by ATExecClusterOn(), ATExecDropCluster(), and rebuild_relation().
|
static |
Definition at line 2828 of file repack.c.
References apply_concurrent_changes(), BufFileClose(), BufFileOpenFileSet(), ConditionVariableCancelSleep(), ConditionVariablePrepareToSleep(), ConditionVariableSleep(), DecodingWorkerShared::cv, decoding_worker, DecodingWorkerFileName(), DecodingWorkerShared::done, dsm_segment_address(), fb(), SharedFileSet::fs, DecodingWorkerShared::last_exported, DecodingWorkerShared::lsn_upto, MAXPGPATH, DecodingWorkerShared::mutex, pgstat_progress_update_param(), PROGRESS_REPACK_PHASE, PROGRESS_REPACK_PHASE_CATCH_UP, DecodingWorkerShared::relid, DecodingWorker::seg, DecodingWorkerShared::sfs, SpinLockAcquire(), and SpinLockRelease().
Referenced by rebuild_relation_finish_concurrent().
|
static |
Definition at line 2307 of file repack.c.
References analyze_rel(), Assert, check_index_is_clusterable(), CLUOPT_ANALYZE, CLUOPT_VERBOSE, cluster_rel(), CommandCounterIncrement(), CommitTransactionCommand(), determine_clustered_index(), ereport, errcode(), errmsg, ERROR, fb(), GetTransactionSnapshot(), InvalidOid, NIL, NoLock, OidIsValid, ClusterParams::options, PopActiveSnapshot(), PushActiveSnapshot(), RangeVarCallbackMaintainsTable(), RangeVarGetRelidExtended(), RelationData::rd_rel, RELATION_IS_OTHER_TEMP, REPACK_COMMAND_CLUSTER, REPACK_COMMAND_REPACK, RepackCommandAsString(), StartTransactionCommand(), stmt, table_open(), VACOPT_ANALYZE, and VACOPT_VERBOSE.
Referenced by ExecRepack().
|
static |
Definition at line 3604 of file repack.c.
References _, elog, ERROR, fb(), StringInfoData::len, Min, pq_getmsgbyte(), pq_parse_errornotice(), PqMsg_ErrorResponse, PqMsg_NoticeResponse, psprintf(), pstrdup(), and ThrowErrorData().
Referenced by ProcessRepackMessages().
Definition at line 3519 of file repack.c.
References ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate, appendBinaryStringInfo(), Assert, StringInfoData::data, data, decoding_worker, DecodingWorker::error_mqh, fb(), HOLD_INTERRUPTS, initStringInfo(), MemoryContextReset(), MemoryContextSwitchTo(), pfree(), ProcessRepackMessage(), RepackMessagePending, RESUME_INTERRUPTS, SHM_MQ_DETACHED, shm_mq_receive(), SHM_MQ_SUCCESS, SHM_MQ_WOULD_BLOCK, and TopMemoryContext.
Referenced by ProcessInterrupts().
|
static |
Definition at line 961 of file repack.c.
References AccessExclusiveLock, Assert, BecomeLockGroupLeader(), CheckRelationLockedByMe(), CheckRelationOidLockedByMe(), copy_table_data(), decoding_worker, fb(), finish_heap_swap(), get_initial_snapshot(), index_close(), IsSystemRelation(), make_new_heap(), mark_index_clustered(), NoLock, OidIsValid, pgstat_progress_update_param(), PopActiveSnapshot(), PROGRESS_REPACK_PHASE, PROGRESS_REPACK_PHASE_FINAL_CLEANUP, PushActiveSnapshot(), rebuild_relation_finish_concurrent(), RelationGetRelid, RepackLockLevel(), start_repack_decoding_worker(), table_close(), table_open(), UpdateActiveSnapshotCommandId(), and verbose.
Referenced by cluster_rel().
|
static |
Definition at line 2976 of file repack.c.
References AccessExclusiveLock, Assert, build_new_indexes(), CheckRelationLockedByMe(), CommandCounterIncrement(), elog, ERROR, fb(), finish_heap_swap(), forboth, foreach_current_index, foreach_oid, foreach_ptr, get_rel_name(), GetFlushRecPtr(), GetXLogInsertEndRecPtr(), i, index_close(), index_open(), initialize_change_context(), INJECTION_POINT, InvalidMultiXactId, InvalidOid, InvalidTransactionId, IsSystemRelation(), lappend(), lfirst_oid, list_free(), list_length(), list_nth_oid(), LockRelationOid(), NIL, NoLock, OidIsValid, pgstat_progress_update_param(), process_concurrent_changes(), PROGRESS_REPACK_PHASE, PROGRESS_REPACK_PHASE_SWAP_REL_FILES, RelationGetIndexList(), RelationGetRelid, release_change_context(), ShareUpdateExclusiveLock, swap_relation_files(), table_close(), TransferPredicateLocksToHeapRelation(), unlikely, and XLogFlush().
Referenced by rebuild_relation().
|
static |
Definition at line 2958 of file repack.c.
References ExecCloseIndices(), fb(), FreeExecutorState(), and pfree().
Referenced by rebuild_relation_finish_concurrent().
|
static |
Definition at line 2279 of file repack.c.
References ACL_MAINTAIN, ACLCHECK_OK, Assert, ereport, errmsg, get_rel_name(), pg_class_aclcheck(), REPACK_COMMAND_CLUSTER, REPACK_COMMAND_REPACK, RepackCommandAsString(), and WARNING.
Referenced by cluster_rel_recheck(), get_tables_to_repack(), and get_tables_to_repack_partitioned().
|
static |
Definition at line 2441 of file repack.c.
References REPACK_COMMAND_CLUSTER, REPACK_COMMAND_REPACK, and REPACK_COMMAND_VACUUMFULL.
Referenced by cluster_rel(), ExecRepack(), process_single_relation(), and repack_is_permitted_for_relation().
Definition at line 469 of file repack.c.
References AccessExclusiveLock, and ShareUpdateExclusiveLock.
Referenced by cluster_rel(), copy_table_data(), ExecRepack(), and rebuild_relation().
|
static |
Definition at line 2678 of file repack.c.
References CompactAttribute::attisdropped, CompactAttribute::attlen, BufFileReadExact(), data, DatumGetPointer(), ereport, errcode(), ERRCODE_DATA_CORRUPTED, errmsg, ERROR, ExecForceStoreHeapTuple(), fb(), HEAPTUPLESIZE, i, ItemPointerSetInvalid(), TupleDescData::natts, palloc(), PointerGetDatum(), RelationGetRelid, SET_VARSIZE(), slot_attisnull(), slot_getsomeattrs(), TupleTableSlot::tts_tupleDescriptor, TupleTableSlot::tts_values, TupleDescCompactAttr(), value, VARATT_IS_EXTERNAL_INDIRECT(), VARHDRSZ, and VARSIZE_ANY().
Referenced by apply_concurrent_changes().
Definition at line 3304 of file repack.c.
References DecodingWorkerShared::backend_pid, DecodingWorkerShared::backend_proc, DecodingWorkerShared::backend_proc_number, BGW_MAXLEN, BGW_NEVER_RESTART, BGWORKER_BACKEND_DATABASE_CONNECTION, BGWORKER_SHMEM_ACCESS, BgWorkerStart_RecoveryFinished, BUFFERALIGN, ConditionVariableCancelSleep(), ConditionVariableInit(), ConditionVariablePrepareToSleep(), ConditionVariableSleep(), DecodingWorkerShared::cv, DecodingWorkerShared::dbid, decoding_worker, DecodingWorkerShared::done, dsm_create(), dsm_segment_address(), dsm_segment_handle(), ereport, errcode(), errhint(), errmsg, ERROR, DecodingWorker::error_mqh, DecodingWorkerShared::error_queue, fb(), get_rel_name(), GetUserId(), DecodingWorker::handle, DecodingWorkerShared::initialized, initialized, InvalidXLogRecPtr, DecodingWorkerShared::last_exported, DecodingWorkerShared::lsn_upto, MAXPGPATH, DecodingWorkerShared::mutex, MyDatabaseId, MyProc, MyProcNumber, MyProcPid, palloc0_object, RegisterDynamicBackgroundWorker(), DecodingWorkerShared::relid, REPACK_ERROR_QUEUE_SIZE, DecodingWorkerShared::roleid, DecodingWorker::seg, DecodingWorkerShared::sfs, SharedFileSetInit(), shm_mq_attach(), shm_mq_create(), shm_mq_set_receiver(), snprintf, SpinLockAcquire(), SpinLockInit(), SpinLockRelease(), and UInt32GetDatum().
Referenced by rebuild_relation().
Definition at line 3395 of file repack.c.
References BGWH_POSTMASTER_DIED, ConditionVariableCancelSleep(), decoding_worker, dsm_detach(), ereport, errcode(), errmsg, DecodingWorker::error_mqh, FATAL, fb(), DecodingWorker::handle, HOLD_INTERRUPTS, pfree(), RESUME_INTERRUPTS, DecodingWorker::seg, shm_mq_detach(), TerminateBackgroundWorker(), and WaitForBackgroundWorkerShutdown().
Referenced by cluster_rel().
|
static |
Definition at line 1483 of file repack.c.
References AccessExclusiveLock, Assert, CacheInvalidateRelcacheByTuple(), CatalogCloseIndexes(), CatalogOpenIndexes(), CatalogTupleUpdateWithInfo(), changeDependencyFor(), deleteDependencyRecordsFor(), DEPENDENCY_INTERNAL, elog, ERROR, fb(), get_namespace_name(), get_rel_name(), get_rel_namespace(), GETSTRUCT(), heap_freetuple(), HeapTupleIsValid, InvalidMultiXactId, InvalidOid, InvalidTransactionId, InvokeObjectPostAlterHookArg, IsSystemClass(), NameStr, NoLock, ObjectIdGetDatum(), recordDependencyOn(), relation_close(), relation_open(), RelationAssumeNewRelfilelocator(), RelationMapOidToFilenumber(), RelationMapUpdateMap(), RelFileNumberIsValid, RowExclusiveLock, SearchSysCacheCopy1, swap_relation_files(), table_close(), table_open(), toast_get_valid_index(), TransactionIdIsNormal, and TransactionIdIsValid.
Referenced by finish_heap_swap(), rebuild_relation_finish_concurrent(), and swap_relation_files().
|
static |
Definition at line 140 of file repack.c.
Referenced by process_concurrent_changes(), ProcessRepackMessages(), rebuild_relation(), start_repack_decoding_worker(), and stop_repack_decoding_worker().
| volatile sig_atomic_t RepackMessagePending = false |
Definition at line 146 of file repack.c.
Referenced by HandleRepackMessageInterrupt(), ProcessInterrupts(), and ProcessRepackMessages().