faultinjector_lists.h 18.0 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92
/*
 * faultinjector_lists.h
 *
 * List of fault injector identifiers, or "fault points", as well as fault
 * injector states and some other things. These are listed using C
 * preprocessor macros. To use, you must define the appropriate FI_* macros
 * before #including this file.
 *
 * For example, to get an array of all the identifier strings, do:
 *
 * const char *FaultInject_Strings[] = {
 * #define FI_IDENT(id, str) str,
 * #include "utils/faultinjector_lists.h"
 * #undef FI_IDENT
 * };
 *
 *
 * To add a new fault injection point, simply add a new FI_IDENT line to the
 * list below.
 *
 *
 * Copyright 2009-2010, Greenplum Inc. All rights reserved.
 * Copyright (c) 2017-Present Pivotal Software, Inc.
 */

/* there is deliberately not an #ifndef FAULTINJECTOR_LISTS_H here */

/*
 * Fault injection points.
 */
#ifdef FI_IDENT
FI_IDENT(FaultInjectorIdNotSpecified = 0, "")
/*
 * affects all faults injected
 *		*) remove all faults injected from the segment
 *		*) display status for all faults injected
 */
FI_IDENT(FaultInjectorIdAll, "all")
/* inject fault when new connection is accepted in postmaster */
FI_IDENT(Postmaster, "postmaster")
/* inject fault when pg_control file is written */
FI_IDENT(PgControl, "pg_control")
/* inject fault when files in pg_xlog directory are written */
FI_IDENT(PgXlog, "pg_xlog")
/* inject fault during start prepare */
FI_IDENT(StartPrepareTx, "start_prepare")
/* inject fault before checkpoint is taken */
FI_IDENT(Checkpoint, "checkpoint")
/* inject fault during transaction start with DistributedTransactionContext in ENTRY_DB_SINGLETON mode */
FI_IDENT(TransactionStartUnderEntryDbSingleton, "transaction_start_under_entry_db_singleton")
/* inject fault after transaction is prepared */
FI_IDENT(TransactionAbortAfterDistributedPrepared, "transaction_abort_after_distributed_prepared")
/* inject fault after persistent state change is permanently stored during first pass */
FI_IDENT(TransactionCommitPass1FromCreatePendingToCreated, "transaction_commit_pass1_from_create_pending_to_created")
/* inject fault after persistent state change is permanently stored during first pass */
FI_IDENT(TransactionCommitPass1FromDropInMemoryToDropPending, "transaction_commit_pass1_from_drop_in_memory_to_drop_pending")
/* inject fault after persistent state change is permanently stored during first pass */
FI_IDENT(TransactionCommitPass1FromAbortingCreateNeededToAbortingCreate, "transaction_commit_pass1_from_aborting_create_needed_to_aborting_create")
/* inject fault after persistent state change is permanently stored during first pass */
FI_IDENT(TransactionAbortPass1FromCreatePendingToAbortingCreate, "transaction_abort_pass1_from_create_pending_to_aborting_create")
/* inject fault after persistent state change is permanently stored during first pass */
FI_IDENT(TransactionAbortPass1FromAbortingCreateNeededToAbortingCreate, "transaction_abort_pass1_from_aborting_create_needed_to_aborting_create")
/* inject fault after physical drop and before final persistent state change is permanently stored during second pass */
FI_IDENT(TransactionCommitPass2FromDropInMemoryToDropPending, "transaction_commit_pass2_from_drop_in_memory_to_drop_pending")
/* inject fault after physical drop and before final persistent state change is permanently stored during second pass */
FI_IDENT(TransactionCommitPass2FromAbortingCreateNeededToAbortingCreate, "transaction_commit_pass2_from_aborting_create_needed_to_aborting_create")
/* inject fault after physical drop and before final persistent state change is permanently stored during second pass */
FI_IDENT(TransactionAbortPass2FromCreatePendingToAbortingCreate, "transaction_abort_pass2_from_create_pending_to_aborting_create")
/* inject fault after physical drop and before final persistent state change is permanently stored during second pass */
FI_IDENT(TransactionAbortPass2FromAbortingCreateNeededToAbortingCreate, "transaction_abort_pass2_from_aborting_create_needed_to_aborting_create")
/* inject fault after persistent state change is permanently stored during first pass */
FI_IDENT(FinishPreparedTransactionCommitPass1FromCreatePendingToCreated, "finish_prepared_transaction_commit_pass1_from_create_pending_to_created")
/* inject fault after physical drop and before final persistent state change is permanently stored during second pass */
FI_IDENT(FinishPreparedTransactionCommitPass2FromCreatePendingToCreated, "finish_prepared_transaction_commit_pass2_from_create_pending_to_created")
/* inject fault after persistent state change is permanently stored during first pass (commit: create pending => created) */
FI_IDENT(FinishPreparedTransactionAbortPass1FromCreatePendingToAbortingCreate, "finish_prepared_transaction_abort_pass1_from_create_pending_to_aborting_create")
/* inject fault after physical drop and before final persistent state change is permanently stored during second pass */
FI_IDENT(FinishPreparedTransactionAbortPass2FromCreatePendingToAbortingCreate, "finish_prepared_transaction_abort_pass2_from_create_pending_to_aborting_create")
/* inject fault after persistent state change is permanently stored during first pass (abort: create pending => aborting create) */
FI_IDENT(FinishPreparedTransactionCommitPass1FromDropInMemoryToDropPending, "finish_prepared_transaction_commit_pass1_from_drop_in_memory_to_drop_pending")
/* inject fault after physical drop and before final persistent state change is permanently stored during second pass */
FI_IDENT(FinishPreparedTransactionCommitPass2FromDropInMemoryToDropPending, "finish_prepared_transaction_commit_pass2_from_drop_in_memory_to_drop_pending")
/* inject fault after persistent state change is permanently stored during first pass (commit: drop in memory => drop pending) */
FI_IDENT(FinishPreparedTransactionCommitPass1AbortingCreateNeeded, "finish_prepared_transaction_commit_pass1_aborting_create_needed")
/* inject fault after physical drop and before final persistent state change is permanently stored during second pass */
FI_IDENT(FinishPreparedTransactionCommitPass2AbortingCreateNeeded, "finish_prepared_transaction_commit_pass2_aborting_create_needed")
/* inject fault after persistent state change is permanently stored during first pass (create pending => created) */
FI_IDENT(FinishPreparedTransactionAbortPass1AbortingCreateNeeded, "finish_prepared_transaction_abort_pass1_aborting_create_needed")
/* inject fault after physical drop and before final persistent state change is permanently stored during second pass */
FI_IDENT(FinishPreparedTransactionAbortPass2AbortingCreateNeeded, "finish_prepared_transaction_abort_pass2_aborting_create_needed")
/* inject fault to start verification (create pending => aborting create) */
FI_IDENT(FileRepVerification, "filerep_verification")
93 94
/* inject fault after transaction is prepared */
FI_IDENT(OnePhaseTransactionCommit, "onephase_transaction_commit")
95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150
/* inject fault before transaction commit is recorded in xlog (trigger filerep verification)*/
FI_IDENT(TwoPhaseTransactionCommitPrepared, "twophase_transaction_commit_prepared")
/* inject fault before transaction abort is recorded in xlog */
FI_IDENT(TwoPhaseTransactionAbortPrepared, "twophase_transaction_abort_prepared")
/* inject fault after prepare broadcast */
FI_IDENT(DtmBroadcastPrepare, "dtm_broadcast_prepare")
/* inject fault after commit broadcast */
FI_IDENT(DtmBroadcastCommitPrepared, "dtm_broadcast_commit_prepared")
/* inject fault after abort broadcast */
FI_IDENT(DtmBroadcastAbortPrepared, "dtm_broadcast_abort_prepared")
/* inject fault after distributed commit was inserted in xlog */
FI_IDENT(DtmXLogDistributedCommit, "dtm_xlog_distributed_commit")
/* inject fault before initializing dtm */
FI_IDENT(DtmInit, "dtm_init")
/* inject sleep after creation of two phase file */
FI_IDENT(EndPreparedTwoPhaseSleep, "end_prepare_two_phase_sleep")
/* inject fault after segment receives state transition request (sleep after creating two phase files) */
FI_IDENT(SegmentTransitionRequest, "segment_transition_request")
/* inject fault after segment is probed by FTS */
FI_IDENT(SegmentProbeResponse, "segment_probe_response")
/* inject fault after recording transaction commit for local transaction  */
FI_IDENT(LocalTmRecordTransactionCommit, "local_tm_record_transaction_commit")
/* inject fault to simulate memory allocation failure */
FI_IDENT(MallocFailure, "malloc_failure")
/* inject fault to simulate transaction abort failure  */
FI_IDENT(AbortTransactionFail, "transaction_abort_failure")
/* inject fault to simulate workfile creation failure  */
FI_IDENT(WorkfileCreationFail, "workfile_creation_failure")
/* inject fault to simulate workfile write failure  */
FI_IDENT(WorkfileWriteFail, "workfile_write_failure")
/* pretend that a query processed billions of rows  */
FI_IDENT(WorkfileHashJoinFailure, "workfile_hashjoin_failure")
/* inject fault before we close workfile in ExecHashJoinNewBatch */
FI_IDENT(ExecutorRunHighProcessed, "executor_run_high_processed")
/* large palloc inside MultiExecHash to attempt to exceed vmem limit */
FI_IDENT(MultiExecHashLargeVmem, "multi_exec_hash_large_vmem")
/* inject fault in ExecSort before doing the actual sort */
FI_IDENT(ExecSortBeforeSorting, "execsort_before_sorting")
/* inject fault in MKSort during the mergeruns phase */
FI_IDENT(ExecSortMKSortMergeRuns, "execsort_mksort_mergeruns")
/* inject fault after shared input scan retrieved a tuple */
FI_IDENT(ExecShareInputNext, "execshare_input_next")
/* inject fault after creation of checkpoint when basebackup requested */
FI_IDENT(BaseBackupPostCreateCheckpoint, "base_backup_post_create_checkpoint")
/* inject fault after compaction, but before the drop of the
 * segment file */
FI_IDENT(CompactionBeforeSegmentFileDropPhase, "compaction_before_segmentfile_drop")
/* inject fault after compaction and drop, but before
 * the cleanup phase for a relation */
FI_IDENT(CompactionBeforeCleanupPhase, "compaction_before_cleanup_phase")
/* inject fault before an append-only insert */
FI_IDENT(AppendOnlyInsert, "appendonly_insert")
/* inject fault before an append-only delete */
FI_IDENT(AppendOnlyDelete, "appendonly_delete")
/* inject fault before an append-only update */
FI_IDENT(AppendOnlyUpdate, "appendonly_update")
151 152
/* inject fault before creating an appendonly hash entry*/
FI_IDENT(BeforeCreatingAnAOHashEntry, "before_creating_an_ao_hash_entry")
153 154
/* inject fault in append-only compression function */
FI_IDENT(AppendOnlySkipCompression, "appendonly_skip_compression")
155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180
/* inject fault while reindex db is in progress */
FI_IDENT(ReindexDB, "reindex_db")
/* inject fault while reindex relation is in progress */
FI_IDENT(ReindexRelation, "reindex_relation")
/* inject fault during scanning of a partition */
FI_IDENT(FaultDuringExecDynamicTableScan, "fault_during_exec_dynamic_table_scan")
/* inject fault at the beginning of rxThreadFunc */
FI_IDENT(FaultInBackgroundWriterMain, "fault_in_background_writer_main")
/* inject fault in cdbCopyStart after dispatch */
FI_IDENT(CdbCopyStartAfterDispatch, "cdb_copy_start_after_dispatch")
/* inject fault at the end of repair_frag */
FI_IDENT(RepairFragEnd, "repair_frag_end")
/* inject fault before truncate in vacuum full */
FI_IDENT(VacuumFullBeforeTruncate, "vacuum_full_before_truncate")
/* inject fault after truncate in vacuum full */
FI_IDENT(VacuumFullAfterTruncate, "vacuum_full_after_truncate")
/* inject fault at the end of first round of vacuumRelation loop */
FI_IDENT(VacuumRelationEndOfFirstRound, "vacuum_relation_end_of_first_round")
/* inject fault during the open relation of the drop phase of vacuumRelation loop */
FI_IDENT(VacuumRelationOpenRelationDuringDropPhase, "vacuum_relation_open_relation_during_drop_phase")
/* inject fault while adding PGPROC to procarray */
FI_IDENT(ProcArray_Add, "procarray_add")
/* inject fault before switching to a new batch in Hash Join */
FI_IDENT(FaultExecHashJoinNewBatch, "exec_hashjoin_new_batch")
/* pause FTS process before committing changes, until shutdown */
FI_IDENT(FtsWaitForShutdown, "fts_wait_for_shutdown")
181 182
/* inject fault in FTS loop */
FI_IDENT(FtsProbe, "fts_probe")
183 184 185 186
/* inject fault in FTS where it updates configuration */
FI_IDENT(FtsUpdateConfig, "fts_update_config")
/* inject fault in FTS message handler */
FI_IDENT(FtsHandleMessage, "fts_handle_message")
187 188 189 190 191 192 193 194 195 196 197 198
/* inject fault before cleaning up a runaway query */
FI_IDENT(RunawayCleanup, "runaway_cleanup")
/* inject fault while translating relcache entries */
FI_IDENT(OptRelcacheTranslatorCatalogAccess, "opt_relcache_translator_catalog_access")
/* inject fault before sending QE details during backend initialization */
FI_IDENT(SendQEDetailsInitBackend, "send_qe_details_init_backend")
/* inject fault in ProcessStartupPacket() */
FI_IDENT(ProcessStartupPacketFault, "process_startup_packet")
/* inject fault in cdbdisp_dispatchX*/
FI_IDENT(AfterOneSliceDispatched, "after_one_slice_dispatched")
/* inject fault in interconnect to skip sending the stop ack */
FI_IDENT(InterconnectStopAckIsLost, "interconnect_stop_ack_is_lost")
199 200
/* inject fault in interconnect to make palloc0 fail in setup */
FI_IDENT(InterconnectSetupPalloc, "interconnect_setup_palloc")
201 202 203 204 205 206
/* inject fault after qe got snapshot and interconnect*/
FI_IDENT(QEGotSnapshotAndInterconnect, "qe_got_snapshot_and_interconnect")
/* inject fault to 'skip' in order to flush all buffers in BgBufferSync() */
FI_IDENT(FsyncCounter, "fsync_counter")
/* inject fault to count buffers fsync'ed by checkpoint process */
FI_IDENT(BgBufferSyncDefaultLogic, "bg_buffer_sync_default_logic")
207 208
/* inject fault in FinishPreparedTransaction() right at start of function */
FI_IDENT(FinishPreparedStartOfFunction, "finish_prepared_start_of_function")
209 210 211 212 213 214 215 216
/* inject fault in FinishPreparedTransaction() after recording the commit prepared record */
FI_IDENT(FinishPreparedAfterRecordCommitPrepared, "finish_prepared_after_record_commit_prepared")
/* inject fault to report ERROR just after creating Gang */
FI_IDENT(GangCreated, "gang_created")
/* inject fault to report ERROR just after resource group is assigned on master */
FI_IDENT(ResGroupAssignedOnMaster, "resgroup_assigned_on_master")
/* inject fault before reading command */
FI_IDENT(BeforeReadCommand, "before_read_command")
G
Gang Xiong 已提交
217 218
/* inject fault before get checkpoint dtx information */
FI_IDENT(CheckPointDtxInfo, "checkpoint_dtx_info")
219 220 221 222
/* inject fault at WalSndLoop() function */
FI_IDENT(WalSenderLoop, "wal_sender_loop")
/* inject fault at SyncRepWaitForLSN function for QueryCancelPending */
FI_IDENT(SyncRepQueryCancel, "sync_rep_query_cancel")
223 224
/* inject fault at start of function DistributedLog_AdvanceOldestXmin() */
FI_IDENT(DistributedLogAdvanceOldestXmin, "distributedlog_advance_oldest_xmin")
225 226
/* inject fault at initialization of wal sender */
FI_IDENT(InitializeWalSender, "initialize_wal_sender")
227 228 229 230 231 232 233
/* inject fault when fts connection is received on primary/mirror */
FI_IDENT(FTSConnStartupPacket, "fts_conn_startup_packet")
/*
 * inject fault to report recovery is hung to FTS. This fault only works with
 * FTSConnStartupPacket fault set to skip.
 */
FI_IDENT(FTSRecoveryInProgress, "fts_recovery_in_progress")
Z
Zhenghua Lyu 已提交
234 235 236 237
/* inject fault after CdbTryOpenRelation function */
FI_IDENT(UpgradeRowLock, "upgrade_row_lock")
/* inject fault in Gdd loop */
FI_IDENT(GddProbe, "gdd_probe")
238 239
/* inject fault after updating pg_database.datfrozenxid (but before committing) */
FI_IDENT(VacuumUpdateDatFrozenXid, "vacuum_update_dat_frozen_xid")
240 241
/* inject fault in initial OS collation locale lookup */
FI_IDENT(CollateLocaleOsLookup, "collate_locale_os_lookup")
J
Jialun 已提交
242 243
/* inject fault before create resource group committing */
FI_IDENT(CreateResourceGroupFail, "create_resource_group_fail")
244 245
/* inject fault before auto vacuum worker calls do_autovacuum */
FI_IDENT(AutoVacWorkerBeforeDoAutovacuum, "auto_vac_worker_before_do_autovacuum")
246 247 248 249
/* inject fault when search DNS cache */
FI_IDENT(GetDnsCachedAddress, "get_dns_cached_address")
/* inject fault before notify fts probe */
FI_IDENT(BeforeFtsNotify, "before_fts_notify")
250 251
/* inject fault before aquiring lock during AlterTableCreateAoBlkdirTable */
FI_IDENT(BeforeAcquireLockDuringCreateAoBlkdirTable, "before_acquire_lock_during_create_ao_blkdir_table")
N
Ning Yu 已提交
252 253
/* inject fault during gang creation, before check for interrupts */
FI_IDENT(CreateGangInProgress, "create_gang_in_progress")
254 255
/* inject fault when creating new TOAST tables, to modify the chunk size */
FI_IDENT(DecreaseToastMaxChunkSize, "decrease_toast_max_chunk_size")
256 257
/* inject fault to let cleanupGang return false */
FI_IDENT(CleanupGang, "cleanup_gang")
258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278
#endif

/*
 * Fault types. These indicate the action to do when the fault injection
 * point is reached.
 */
#ifdef FI_TYPE
FI_TYPE(FaultInjectorTypeNotSpecified = 0, "")
FI_TYPE(FaultInjectorTypeSleep, "sleep")
FI_TYPE(FaultInjectorTypeFatal, "fatal")
FI_TYPE(FaultInjectorTypePanic, "panic")
FI_TYPE(FaultInjectorTypeError, "error")
FI_TYPE(FaultInjectorTypeInfiniteLoop, "infinite_loop")
FI_TYPE(FaultInjectorTypeSuspend, "suspend")
FI_TYPE(FaultInjectorTypeResume, "resume")
FI_TYPE(FaultInjectorTypeSkip, "skip")
FI_TYPE(FaultInjectorTypeReset, "reset")
FI_TYPE(FaultInjectorTypeStatus, "status")
FI_TYPE(FaultInjectorTypeSegv, "segv")
FI_TYPE(FaultInjectorTypeInterrupt, "interrupt")
FI_TYPE(FaultInjectorTypeFinishPending, "finish_pending")
279
FI_TYPE(FaultInjectorTypeWaitUntilTriggered, "wait_until_triggered")
280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314
#endif

/*
 *
 */
#ifdef FI_DDL_STATEMENT
FI_DDL_STATEMENT(DDLNotSpecified = 0, "")
FI_DDL_STATEMENT(CreateDatabase, "create_database")
FI_DDL_STATEMENT(DropDatabase, "drop_database")
FI_DDL_STATEMENT(CreateTable, "create_table")
FI_DDL_STATEMENT(DropTable, "drop_table")
FI_DDL_STATEMENT(CreateIndex, "create_index")
FI_DDL_STATEMENT(AlterIndex, "alter_index")
FI_DDL_STATEMENT(ReIndex, "reindex")
FI_DDL_STATEMENT(DropIndex, "drop_index")
FI_DDL_STATEMENT(CreateTablespaces, "create_tablespaces")
FI_DDL_STATEMENT(DropTablespaces, "drop_tablespaces")
FI_DDL_STATEMENT(Truncate, "truncate")
FI_DDL_STATEMENT(Vacuum, "vacuum")
#endif

/*
 *
 */
#ifdef FI_STATE
FI_STATE(FaultInjectorStateNotInitialized = 0, "not initialized")
/* Request is waiting to be injected */
FI_STATE(FaultInjectorStateWaiting, "set")
/* Fault is injected */
FI_STATE(FaultInjectorStateTriggered, "triggered")
/* Fault was injected and completed successfully */
FI_STATE(FaultInjectorStateCompleted, "completed")
/* Fault was NOT injected */
FI_STATE(FaultInjectorStateFailed, "failed")
#endif