PostgreSQL Source Code git master
Loading...
Searching...
No Matches
backend_progress.c File Reference
#include "postgres.h"
#include "access/parallel.h"
#include "libpq/pqformat.h"
#include "utils/backend_progress.h"
#include "utils/backend_status.h"
Include dependency graph for backend_progress.c:

Go to the source code of this file.

Functions

void pgstat_progress_start_command (ProgressCommandType cmdtype, Oid relid)
 
void pgstat_progress_update_param (int index, int64 val)
 
void pgstat_progress_incr_param (int index, int64 incr)
 
void pgstat_progress_parallel_incr_param (int index, int64 incr)
 
void pgstat_progress_update_multi_param (int nparam, const int *index, const int64 *val)
 
void pgstat_progress_end_command (void)
 

Function Documentation

◆ pgstat_progress_end_command()

void pgstat_progress_end_command ( void  )

Definition at line 150 of file backend_progress.c.

151{
153
155 return;
156
157 if (beentry->st_progress_command == PROGRESS_COMMAND_INVALID)
158 return;
159
161 beentry->st_progress_command = PROGRESS_COMMAND_INVALID;
162 beentry->st_progress_command_target = InvalidOid;
164}
@ PROGRESS_COMMAND_INVALID
PgBackendStatus * MyBEEntry
bool pgstat_track_activities
#define PGSTAT_END_WRITE_ACTIVITY(beentry)
#define PGSTAT_BEGIN_WRITE_ACTIVITY(beentry)
#define InvalidOid
static int fb(int x)

References fb(), InvalidOid, MyBEEntry, PGSTAT_BEGIN_WRITE_ACTIVITY, PGSTAT_END_WRITE_ACTIVITY, pgstat_track_activities, and PROGRESS_COMMAND_INVALID.

Referenced by AbortSubTransaction(), AbortTransaction(), analyze_rel(), basebackup_progress_done(), cluster_rel(), DefineIndex(), EndCopy(), EndCopyFrom(), heap_vacuum_rel(), reindex_index(), and ReindexRelationConcurrently().

◆ pgstat_progress_incr_param()

void pgstat_progress_incr_param ( int  index,
int64  incr 
)

◆ pgstat_progress_parallel_incr_param()

void pgstat_progress_parallel_incr_param ( int  index,
int64  incr 
)

Definition at line 91 of file backend_progress.c.

92{
93 /*
94 * Parallel workers notify a leader through a PqMsg_Progress message to
95 * update progress, passing the progress index and incremented value.
96 * Leaders can just call pgstat_progress_incr_param directly.
97 */
98 if (IsParallelWorker())
99 {
101
103
108 }
109 else
111}
void pgstat_progress_incr_param(int index, int64 incr)
#define IsParallelWorker()
Definition parallel.h:60
void pq_endmessage(StringInfo buf)
Definition pqformat.c:296
void pq_beginmessage(StringInfo buf, char msgtype)
Definition pqformat.c:88
static void pq_sendint32(StringInfo buf, uint32 i)
Definition pqformat.h:144
static void pq_sendint64(StringInfo buf, uint64 i)
Definition pqformat.h:152
#define PqMsg_Progress
Definition protocol.h:70
void initStringInfo(StringInfo str)
Definition stringinfo.c:97

References fb(), initStringInfo(), IsParallelWorker, pgstat_progress_incr_param(), pq_beginmessage(), pq_endmessage(), pq_sendint32(), pq_sendint64(), and PqMsg_Progress.

Referenced by parallel_vacuum_main(), parallel_vacuum_process_one_index(), and vacuum_delay_point().

◆ pgstat_progress_start_command()

void pgstat_progress_start_command ( ProgressCommandType  cmdtype,
Oid  relid 
)

Definition at line 27 of file backend_progress.c.

28{
30
32 return;
33
35 beentry->st_progress_command = cmdtype;
36 beentry->st_progress_command_target = relid;
37 MemSet(&beentry->st_progress_param, 0, sizeof(beentry->st_progress_param));
39}
#define MemSet(start, val, len)
Definition c.h:1013

References fb(), MemSet, MyBEEntry, PGSTAT_BEGIN_WRITE_ACTIVITY, PGSTAT_END_WRITE_ACTIVITY, and pgstat_track_activities.

Referenced by analyze_rel(), bbsink_progress_new(), BeginCopyFrom(), BeginCopyTo(), cluster_rel(), DefineIndex(), heap_vacuum_rel(), reindex_index(), and ReindexRelationConcurrently().

◆ pgstat_progress_update_multi_param()

◆ pgstat_progress_update_param()

void pgstat_progress_update_param ( int  index,
int64  val 
)

Definition at line 48 of file backend_progress.c.

49{
51
53
55 return;
56
58 beentry->st_progress_param[index] = val;
60}

References Assert, fb(), MyBEEntry, PGSTAT_BEGIN_WRITE_ACTIVITY, PGSTAT_END_WRITE_ACTIVITY, PGSTAT_NUM_PROGRESS_PARAM, pgstat_track_activities, and val.

Referenced by _bt_leafbuild(), _bt_load(), _bt_parallel_scan_and_sort(), _bt_spools_heapscan(), _gin_parallel_merge(), _gin_process_worker_data(), _h_indexbuild(), acquire_inherited_sample_rows(), acquire_sample_rows(), analyze_rel(), basebackup_progress_estimate_backup_size(), basebackup_progress_transfer_wal(), basebackup_progress_wait_checkpoint(), bbsink_progress_end_archive(), bbsink_progress_new(), btvacuumscan(), BuildRelationExtStatistics(), cluster_rel(), copy_dest_receive(), CopyFrom(), CopyLoadRawBuf(), CopyMultiInsertBufferFlush(), CopyRelationTo(), CopySendEndOfRow(), DefineIndex(), do_analyze_rel(), finish_heap_swap(), ginbuild(), hashbuild(), heap_vacuum_rel(), heapam_index_build_range_scan(), heapam_index_validate_scan(), heapam_relation_copy_for_cluster(), lazy_cleanup_all_indexes(), lazy_scan_heap(), lazy_truncate_heap(), lazy_vacuum_all_indexes(), lazy_vacuum_heap_page(), lazy_vacuum_heap_rel(), reindex_index(), reindex_relation(), ReindexRelationConcurrently(), validate_index(), WaitForLockersMultiple(), and WaitForOlderSnapshots().