78#define FSYNCS_PER_ABSORB 10
79#define UNLINKS_PER_ABSORB 10
145 "Pending ops context",
243 errmsg(
"could not remove file \"%s\": %m", path)));
254 if (--absorb_counter <= 0)
275 for (
int i = 0;
i < ntodelete;
i++)
288 static bool sync_in_progress =
false;
308 elog(
ERROR,
"cannot sync without a pendingOps table");
345 if (sync_in_progress)
359 sync_in_progress =
true;
393 if (--absorb_counter <= 0)
410 for (failures = 0; !entry->
canceled; failures++)
420 sync_diff = sync_end;
425 total_elapsed += elapsed;
429 elog(
DEBUG1,
"checkpoint sync: number=%d file=%s time=%.3f ms",
432 (
double) elapsed / 1000);
446 errmsg(
"could not fsync file \"%s\": %m",
474 sync_in_progress =
false;
611 if (ret || (!ret && !retryOnError))
615 WAIT_EVENT_REGISTER_SYNC_REQUEST);
#define Assert(condition)
bool ForwardSyncRequest(const FileTag *ftag, SyncRequestType type)
void AbsorbSyncRequests(void)
int clogsyncfiletag(const FileTag *ftag, char *path)
int committssyncfiletag(const FileTag *ftag, char *path)
void * hash_search(HTAB *hashp, const void *keyPtr, HASHACTION action, bool *foundPtr)
void * hash_seq_search(HASH_SEQ_STATUS *status)
HTAB * hash_create(const char *tabname, long nelem, const HASHCTL *info, int flags)
void hash_seq_init(HASH_SEQ_STATUS *status, HTAB *hashp)
int errmsg_internal(const char *fmt,...)
int errcode_for_file_access(void)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
int data_sync_elevel(int elevel)
#define FILE_POSSIBLY_DELETED(err)
#define INSTR_TIME_SET_CURRENT(t)
#define INSTR_TIME_SUBTRACT(x, y)
#define INSTR_TIME_GET_MICROSEC(t)
int WaitLatch(Latch *latch, int wakeEvents, long timeout, uint32 wait_event_info)
#define WL_EXIT_ON_PM_DEATH
List * lappend(List *list, void *datum)
List * list_delete_first_n(List *list, int n)
void list_free_deep(List *list)
void pfree(void *pointer)
MemoryContext TopMemoryContext
void MemoryContextAllowInCriticalSection(MemoryContext context, bool allow)
bool mdfiletagmatches(const FileTag *ftag, const FileTag *candidate)
int mdunlinkfiletag(const FileTag *ftag, char *path)
int mdsyncfiletag(const FileTag *ftag, char *path)
#define AllocSetContextCreate
#define ALLOCSET_DEFAULT_SIZES
#define AmCheckpointerProcess()
int multixactoffsetssyncfiletag(const FileTag *ftag, char *path)
int multixactmemberssyncfiletag(const FileTag *ftag, char *path)
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
static void * list_nth(const List *list, int n)
static int list_cell_number(const List *l, const ListCell *c)
static chr * longest(struct vars *v, struct dfa *d, chr *start, chr *stop, int *hitstopp)
uint64 ckpt_agg_sync_time
int(* sync_syncfiletag)(const FileTag *ftag, char *path)
bool(* sync_filetagmatches)(const FileTag *ftag, const FileTag *candidate)
int(* sync_unlinkfiletag)(const FileTag *ftag, char *path)
void ProcessSyncRequests(void)
static CycleCtr checkpoint_cycle_ctr
void SyncPreCheckpoint(void)
static List * pendingUnlinks
#define UNLINKS_PER_ABSORB
static const SyncOps syncsw[]
static MemoryContext pendingOpsCxt
void RememberSyncRequest(const FileTag *ftag, SyncRequestType type)
static CycleCtr sync_cycle_ctr
#define FSYNCS_PER_ABSORB
void SyncPostCheckpoint(void)
bool RegisterSyncRequest(const FileTag *ftag, SyncRequestType type, bool retryOnError)
@ SYNC_HANDLER_MULTIXACT_MEMBER
@ SYNC_HANDLER_MULTIXACT_OFFSET
CheckpointStatsData CheckpointStats