PostgreSQL Source Code git master
Loading...
Searching...
No Matches
xactdesc.c File Reference
#include "postgres.h"
#include "access/transam.h"
#include "access/xact.h"
#include "replication/origin.h"
#include "storage/sinval.h"
#include "storage/standbydefs.h"
#include "utils/timestamp.h"
Include dependency graph for xactdesc.c:

Go to the source code of this file.

Functions

void ParseCommitRecord (uint8 info, xl_xact_commit *xlrec, xl_xact_parsed_commit *parsed)
 
void ParseAbortRecord (uint8 info, xl_xact_abort *xlrec, xl_xact_parsed_abort *parsed)
 
void ParsePrepareRecord (uint8 info, xl_xact_prepare *xlrec, xl_xact_parsed_prepare *parsed)
 
static void xact_desc_relations (StringInfo buf, char *label, int nrels, RelFileLocator *xlocators)
 
static void xact_desc_subxacts (StringInfo buf, int nsubxacts, TransactionId *subxacts)
 
static void xact_desc_stats (StringInfo buf, const char *label, int ndropped, xl_xact_stats_item *dropped_stats)
 
static void xact_desc_commit (StringInfo buf, uint8 info, xl_xact_commit *xlrec, ReplOriginId origin_id)
 
static void xact_desc_abort (StringInfo buf, uint8 info, xl_xact_abort *xlrec, ReplOriginId origin_id)
 
static void xact_desc_prepare (StringInfo buf, uint8 info, xl_xact_prepare *xlrec, ReplOriginId origin_id)
 
static void xact_desc_assignment (StringInfo buf, xl_xact_assignment *xlrec)
 
void xact_desc (StringInfo buf, XLogReaderState *record)
 
const charxact_identify (uint8 info)
 

Function Documentation

◆ ParseAbortRecord()

void ParseAbortRecord ( uint8  info,
xl_xact_abort xlrec,
xl_xact_parsed_abort parsed 
)

Definition at line 141 of file xactdesc.c.

142{
143 char *data = ((char *) xlrec) + MinSizeOfXactAbort;
144
145 memset(parsed, 0, sizeof(*parsed));
146
147 parsed->xinfo = 0; /* default, if no XLOG_XACT_HAS_INFO is
148 * present */
149
150 parsed->xact_time = xlrec->xact_time;
151
152 if (info & XLOG_XACT_HAS_INFO)
153 {
155
156 parsed->xinfo = xl_xinfo->xinfo;
157
158 data += sizeof(xl_xact_xinfo);
159 }
160
161 if (parsed->xinfo & XACT_XINFO_HAS_DBINFO)
162 {
164
165 parsed->dbId = xl_dbinfo->dbId;
166 parsed->tsId = xl_dbinfo->tsId;
167
168 data += sizeof(xl_xact_dbinfo);
169 }
170
171 if (parsed->xinfo & XACT_XINFO_HAS_SUBXACTS)
172 {
174
175 parsed->nsubxacts = xl_subxacts->nsubxacts;
176 parsed->subxacts = xl_subxacts->subxacts;
177
179 data += parsed->nsubxacts * sizeof(TransactionId);
180 }
181
183 {
185
186 parsed->nrels = xl_rellocator->nrels;
187 parsed->xlocators = xl_rellocator->xlocators;
188
190 data += xl_rellocator->nrels * sizeof(RelFileLocator);
191 }
192
194 {
196
197 parsed->nstats = xl_drops->nitems;
198 parsed->stats = xl_drops->items;
199
201 data += xl_drops->nitems * sizeof(xl_xact_stats_item);
202 }
203
204 if (parsed->xinfo & XACT_XINFO_HAS_TWOPHASE)
205 {
207
208 parsed->twophase_xid = xl_twophase->xid;
209
210 data += sizeof(xl_xact_twophase);
211
212 if (parsed->xinfo & XACT_XINFO_HAS_GID)
213 {
214 strlcpy(parsed->twophase_gid, data, sizeof(parsed->twophase_gid));
215 data += strlen(data) + 1;
216 }
217 }
218
219 /* Note: no alignment is guaranteed after this point */
220
221 if (parsed->xinfo & XACT_XINFO_HAS_ORIGIN)
222 {
224
225 /* no alignment is guaranteed, so copy onto stack */
226 memcpy(&xl_origin, data, sizeof(xl_origin));
227
228 parsed->origin_lsn = xl_origin.origin_lsn;
229 parsed->origin_timestamp = xl_origin.origin_timestamp;
230
231 data += sizeof(xl_xact_origin);
232 }
233}
uint32 TransactionId
Definition c.h:666
const void * data
size_t strlcpy(char *dst, const char *src, size_t siz)
Definition strlcpy.c:45
static int fb(int x)
TransactionId xid
Definition xact.h:312
uint32 xinfo
Definition xact.h:253
#define MinSizeOfXactSubxacts
Definition xact.h:267
#define XACT_XINFO_HAS_GID
Definition xact.h:196
#define XACT_XINFO_HAS_ORIGIN
Definition xact.h:194
#define XACT_XINFO_HAS_TWOPHASE
Definition xact.h:193
#define MinSizeOfXactRelfileLocators
Definition xact.h:274
#define MinSizeOfXactStatsItems
Definition xact.h:301
#define XACT_XINFO_HAS_RELFILELOCATORS
Definition xact.h:191
#define MinSizeOfXactAbort
Definition xact.h:351
#define XACT_XINFO_HAS_DBINFO
Definition xact.h:189
#define XLOG_XACT_HAS_INFO
Definition xact.h:183
#define XACT_XINFO_HAS_SUBXACTS
Definition xact.h:190
#define XACT_XINFO_HAS_DROPPED_STATS
Definition xact.h:197

References data, xl_xact_dbinfo::dbId, fb(), MinSizeOfXactAbort, MinSizeOfXactRelfileLocators, MinSizeOfXactStatsItems, MinSizeOfXactSubxacts, xl_xact_stats_items::nitems, xl_xact_relfilelocators::nrels, xl_xact_subxacts::nsubxacts, strlcpy(), XACT_XINFO_HAS_DBINFO, XACT_XINFO_HAS_DROPPED_STATS, XACT_XINFO_HAS_GID, XACT_XINFO_HAS_ORIGIN, XACT_XINFO_HAS_RELFILELOCATORS, XACT_XINFO_HAS_SUBXACTS, XACT_XINFO_HAS_TWOPHASE, xl_xact_twophase::xid, xl_xact_xinfo::xinfo, and XLOG_XACT_HAS_INFO.

Referenced by recoveryStopsAfter(), recoveryStopsBefore(), SummarizeXactRecord(), xact_decode(), xact_desc_abort(), and xact_redo().

◆ ParseCommitRecord()

void ParseCommitRecord ( uint8  info,
xl_xact_commit xlrec,
xl_xact_parsed_commit parsed 
)

Definition at line 35 of file xactdesc.c.

36{
37 char *data = ((char *) xlrec) + MinSizeOfXactCommit;
38
39 memset(parsed, 0, sizeof(*parsed));
40
41 parsed->xinfo = 0; /* default, if no XLOG_XACT_HAS_INFO is
42 * present */
43
44 parsed->xact_time = xlrec->xact_time;
45
46 if (info & XLOG_XACT_HAS_INFO)
47 {
49
50 parsed->xinfo = xl_xinfo->xinfo;
51
52 data += sizeof(xl_xact_xinfo);
53 }
54
55 if (parsed->xinfo & XACT_XINFO_HAS_DBINFO)
56 {
58
59 parsed->dbId = xl_dbinfo->dbId;
60 parsed->tsId = xl_dbinfo->tsId;
61
62 data += sizeof(xl_xact_dbinfo);
63 }
64
66 {
68
69 parsed->nsubxacts = xl_subxacts->nsubxacts;
70 parsed->subxacts = xl_subxacts->subxacts;
71
73 data += parsed->nsubxacts * sizeof(TransactionId);
74 }
75
77 {
79
80 parsed->nrels = xl_rellocators->nrels;
81 parsed->xlocators = xl_rellocators->xlocators;
82
84 data += xl_rellocators->nrels * sizeof(RelFileLocator);
85 }
86
88 {
90
91 parsed->nstats = xl_drops->nitems;
92 parsed->stats = xl_drops->items;
93
95 data += xl_drops->nitems * sizeof(xl_xact_stats_item);
96 }
97
98 if (parsed->xinfo & XACT_XINFO_HAS_INVALS)
99 {
101
102 parsed->nmsgs = xl_invals->nmsgs;
103 parsed->msgs = xl_invals->msgs;
104
106 data += xl_invals->nmsgs * sizeof(SharedInvalidationMessage);
107 }
108
109 if (parsed->xinfo & XACT_XINFO_HAS_TWOPHASE)
110 {
112
113 parsed->twophase_xid = xl_twophase->xid;
114
115 data += sizeof(xl_xact_twophase);
116
117 if (parsed->xinfo & XACT_XINFO_HAS_GID)
118 {
119 strlcpy(parsed->twophase_gid, data, sizeof(parsed->twophase_gid));
120 data += strlen(data) + 1;
121 }
122 }
123
124 /* Note: no alignment is guaranteed after this point */
125
126 if (parsed->xinfo & XACT_XINFO_HAS_ORIGIN)
127 {
129
130 /* no alignment is guaranteed, so copy onto stack */
131 memcpy(&xl_origin, data, sizeof(xl_origin));
132
133 parsed->origin_lsn = xl_origin.origin_lsn;
134 parsed->origin_timestamp = xl_origin.origin_timestamp;
135
136 data += sizeof(xl_xact_origin);
137 }
138}
#define MinSizeOfXactInvals
Definition xact.h:308
#define MinSizeOfXactCommit
Definition xact.h:335
#define XACT_XINFO_HAS_INVALS
Definition xact.h:192

References data, xl_xact_dbinfo::dbId, fb(), MinSizeOfXactCommit, MinSizeOfXactInvals, MinSizeOfXactRelfileLocators, MinSizeOfXactStatsItems, MinSizeOfXactSubxacts, xl_xact_stats_items::nitems, xl_xact_invals::nmsgs, xl_xact_relfilelocators::nrels, xl_xact_subxacts::nsubxacts, strlcpy(), XACT_XINFO_HAS_DBINFO, XACT_XINFO_HAS_DROPPED_STATS, XACT_XINFO_HAS_GID, XACT_XINFO_HAS_INVALS, XACT_XINFO_HAS_ORIGIN, XACT_XINFO_HAS_RELFILELOCATORS, XACT_XINFO_HAS_SUBXACTS, XACT_XINFO_HAS_TWOPHASE, xl_xact_twophase::xid, xl_xact_xinfo::xinfo, and XLOG_XACT_HAS_INFO.

Referenced by recoveryStopsAfter(), recoveryStopsBefore(), SummarizeXactRecord(), xact_decode(), xact_desc_commit(), and xact_redo().

◆ ParsePrepareRecord()

void ParsePrepareRecord ( uint8  info,
xl_xact_prepare xlrec,
xl_xact_parsed_prepare parsed 
)

Definition at line 239 of file xactdesc.c.

240{
241 char *bufptr;
242
243 bufptr = ((char *) xlrec) + MAXALIGN(sizeof(xl_xact_prepare));
244
245 memset(parsed, 0, sizeof(*parsed));
246
247 parsed->xact_time = xlrec->prepared_at;
248 parsed->origin_lsn = xlrec->origin_lsn;
249 parsed->origin_timestamp = xlrec->origin_timestamp;
250 parsed->twophase_xid = xlrec->xid;
251 parsed->dbId = xlrec->database;
252 parsed->nsubxacts = xlrec->nsubxacts;
253 parsed->nrels = xlrec->ncommitrels;
254 parsed->nabortrels = xlrec->nabortrels;
255 parsed->nstats = xlrec->ncommitstats;
256 parsed->nabortstats = xlrec->nabortstats;
257 parsed->nmsgs = xlrec->ninvalmsgs;
258
259 strncpy(parsed->twophase_gid, bufptr, xlrec->gidlen);
260 bufptr += MAXALIGN(xlrec->gidlen);
261
262 parsed->subxacts = (TransactionId *) bufptr;
263 bufptr += MAXALIGN(xlrec->nsubxacts * sizeof(TransactionId));
264
265 parsed->xlocators = (RelFileLocator *) bufptr;
266 bufptr += MAXALIGN(xlrec->ncommitrels * sizeof(RelFileLocator));
267
268 parsed->abortlocators = (RelFileLocator *) bufptr;
269 bufptr += MAXALIGN(xlrec->nabortrels * sizeof(RelFileLocator));
270
271 parsed->stats = (xl_xact_stats_item *) bufptr;
272 bufptr += MAXALIGN(xlrec->ncommitstats * sizeof(xl_xact_stats_item));
273
274 parsed->abortstats = (xl_xact_stats_item *) bufptr;
275 bufptr += MAXALIGN(xlrec->nabortstats * sizeof(xl_xact_stats_item));
276
277 parsed->msgs = (SharedInvalidationMessage *) bufptr;
278 bufptr += MAXALIGN(xlrec->ninvalmsgs * sizeof(SharedInvalidationMessage));
279}
#define MAXALIGN(LEN)
Definition c.h:826

References fb(), and MAXALIGN.

Referenced by xact_decode(), and xact_desc_prepare().

◆ xact_desc()

void xact_desc ( StringInfo  buf,
XLogReaderState record 
)

Definition at line 439 of file xactdesc.c.

440{
441 char *rec = XLogRecGetData(record);
442 uint8 info = XLogRecGetInfo(record) & XLOG_XACT_OPMASK;
443
444 if (info == XLOG_XACT_COMMIT || info == XLOG_XACT_COMMIT_PREPARED)
445 {
447
449 XLogRecGetOrigin(record));
450 }
451 else if (info == XLOG_XACT_ABORT || info == XLOG_XACT_ABORT_PREPARED)
452 {
454
456 XLogRecGetOrigin(record));
457 }
458 else if (info == XLOG_XACT_PREPARE)
459 {
461
463 XLogRecGetOrigin(record));
464 }
465 else if (info == XLOG_XACT_ASSIGNMENT)
466 {
468
469 /*
470 * Note that we ignore the WAL record's xid, since we're more
471 * interested in the top-level xid that issued the record and which
472 * xids are being reported here.
473 */
474 appendStringInfo(buf, "xtop %u: ", xlrec->xtop);
476 }
477 else if (info == XLOG_XACT_INVALIDATIONS)
478 {
480
482 InvalidOid, false);
483 }
484}
uint8_t uint8
Definition c.h:544
static char buf[DEFAULT_XLOG_SEG_SIZE]
#define InvalidOid
void standby_desc_invalidations(StringInfo buf, int nmsgs, SharedInvalidationMessage *msgs, Oid dbId, Oid tsId, bool relcacheInitFileInval)
void appendStringInfo(StringInfo str, const char *fmt,...)
Definition stringinfo.c:145
#define XLOG_XACT_COMMIT_PREPARED
Definition xact.h:173
#define XLOG_XACT_INVALIDATIONS
Definition xact.h:176
#define XLOG_XACT_PREPARE
Definition xact.h:171
#define XLOG_XACT_COMMIT
Definition xact.h:170
#define XLOG_XACT_OPMASK
Definition xact.h:180
#define XLOG_XACT_ABORT
Definition xact.h:172
#define XLOG_XACT_ASSIGNMENT
Definition xact.h:175
#define XLOG_XACT_ABORT_PREPARED
Definition xact.h:174
static void xact_desc_commit(StringInfo buf, uint8 info, xl_xact_commit *xlrec, ReplOriginId origin_id)
Definition xactdesc.c:334
static void xact_desc_assignment(StringInfo buf, xl_xact_assignment *xlrec)
Definition xactdesc.c:428
static void xact_desc_abort(StringInfo buf, uint8 info, xl_xact_abort *xlrec, ReplOriginId origin_id)
Definition xactdesc.c:370
static void xact_desc_prepare(StringInfo buf, uint8 info, xl_xact_prepare *xlrec, ReplOriginId origin_id)
Definition xactdesc.c:397
#define XLogRecGetOrigin(decoder)
Definition xlogreader.h:412
#define XLogRecGetInfo(decoder)
Definition xlogreader.h:409
#define XLogRecGetData(decoder)
Definition xlogreader.h:414

References appendStringInfo(), buf, fb(), InvalidOid, standby_desc_invalidations(), xact_desc_abort(), xact_desc_assignment(), xact_desc_commit(), xact_desc_prepare(), XLOG_XACT_ABORT, XLOG_XACT_ABORT_PREPARED, XLOG_XACT_ASSIGNMENT, XLOG_XACT_COMMIT, XLOG_XACT_COMMIT_PREPARED, XLOG_XACT_INVALIDATIONS, XLOG_XACT_OPMASK, XLOG_XACT_PREPARE, XLogRecGetData, XLogRecGetInfo, and XLogRecGetOrigin.

◆ xact_desc_abort()

static void xact_desc_abort ( StringInfo  buf,
uint8  info,
xl_xact_abort xlrec,
ReplOriginId  origin_id 
)
static

Definition at line 370 of file xactdesc.c.

371{
373
375
376 /* If this is a prepared xact, show the xid of the original xact */
377 if (TransactionIdIsValid(parsed.twophase_xid))
378 appendStringInfo(buf, "%u: ", parsed.twophase_xid);
379
381
382 xact_desc_relations(buf, "rels", parsed.nrels, parsed.xlocators);
383 xact_desc_subxacts(buf, parsed.nsubxacts, parsed.subxacts);
384
385 if (parsed.xinfo & XACT_XINFO_HAS_ORIGIN)
386 {
387 appendStringInfo(buf, "; origin: node %u, lsn %X/%08X, at %s",
388 origin_id,
389 LSN_FORMAT_ARGS(parsed.origin_lsn),
390 timestamptz_to_str(parsed.origin_timestamp));
391 }
392
393 xact_desc_stats(buf, "", parsed.nstats, parsed.stats);
394}
const char * timestamptz_to_str(TimestampTz t)
Definition timestamp.c:1862
void appendStringInfoString(StringInfo str, const char *s)
Definition stringinfo.c:230
#define TransactionIdIsValid(xid)
Definition transam.h:41
static void xact_desc_stats(StringInfo buf, const char *label, int ndropped, xl_xact_stats_item *dropped_stats)
Definition xactdesc.c:312
static void xact_desc_relations(StringInfo buf, char *label, int nrels, RelFileLocator *xlocators)
Definition xactdesc.c:282
static void xact_desc_subxacts(StringInfo buf, int nsubxacts, TransactionId *subxacts)
Definition xactdesc.c:299
void ParseAbortRecord(uint8 info, xl_xact_abort *xlrec, xl_xact_parsed_abort *parsed)
Definition xactdesc.c:141
#define LSN_FORMAT_ARGS(lsn)
Definition xlogdefs.h:47

References appendStringInfo(), appendStringInfoString(), buf, fb(), LSN_FORMAT_ARGS, ParseAbortRecord(), timestamptz_to_str(), TransactionIdIsValid, xact_desc_relations(), xact_desc_stats(), xact_desc_subxacts(), and XACT_XINFO_HAS_ORIGIN.

Referenced by xact_desc().

◆ xact_desc_assignment()

static void xact_desc_assignment ( StringInfo  buf,
xl_xact_assignment xlrec 
)
static

Definition at line 428 of file xactdesc.c.

429{
430 int i;
431
432 appendStringInfoString(buf, "subxacts:");
433
434 for (i = 0; i < xlrec->nsubxacts; i++)
435 appendStringInfo(buf, " %u", xlrec->xsub[i]);
436}
int i
Definition isn.c:77

References appendStringInfo(), appendStringInfoString(), buf, fb(), and i.

Referenced by xact_desc().

◆ xact_desc_commit()

static void xact_desc_commit ( StringInfo  buf,
uint8  info,
xl_xact_commit xlrec,
ReplOriginId  origin_id 
)
static

Definition at line 334 of file xactdesc.c.

335{
337
339
340 /* If this is a prepared xact, show the xid of the original xact */
341 if (TransactionIdIsValid(parsed.twophase_xid))
342 appendStringInfo(buf, "%u: ", parsed.twophase_xid);
343
345
346 xact_desc_relations(buf, "rels", parsed.nrels, parsed.xlocators);
347 xact_desc_subxacts(buf, parsed.nsubxacts, parsed.subxacts);
348 xact_desc_stats(buf, "", parsed.nstats, parsed.stats);
349
351 parsed.tsId,
353
355 appendStringInfoString(buf, "; apply_feedback");
356
358 appendStringInfoString(buf, "; sync");
359
360 if (parsed.xinfo & XACT_XINFO_HAS_ORIGIN)
361 {
362 appendStringInfo(buf, "; origin: node %u, lsn %X/%08X, at %s",
363 origin_id,
364 LSN_FORMAT_ARGS(parsed.origin_lsn),
365 timestamptz_to_str(parsed.origin_timestamp));
366 }
367}
#define XactCompletionForceSyncCommit(xinfo)
Definition xact.h:216
#define XactCompletionApplyFeedback(xinfo)
Definition xact.h:212
#define XactCompletionRelcacheInitFileInval(xinfo)
Definition xact.h:214
void ParseCommitRecord(uint8 info, xl_xact_commit *xlrec, xl_xact_parsed_commit *parsed)
Definition xactdesc.c:35

References appendStringInfo(), appendStringInfoString(), buf, fb(), LSN_FORMAT_ARGS, ParseCommitRecord(), standby_desc_invalidations(), timestamptz_to_str(), TransactionIdIsValid, xact_desc_relations(), xact_desc_stats(), xact_desc_subxacts(), XACT_XINFO_HAS_ORIGIN, XactCompletionApplyFeedback, XactCompletionForceSyncCommit, and XactCompletionRelcacheInitFileInval.

Referenced by xact_desc().

◆ xact_desc_prepare()

static void xact_desc_prepare ( StringInfo  buf,
uint8  info,
xl_xact_prepare xlrec,
ReplOriginId  origin_id 
)
static

Definition at line 397 of file xactdesc.c.

398{
400
402
403 appendStringInfo(buf, "gid %s: ", parsed.twophase_gid);
405
406 xact_desc_relations(buf, "rels(commit)", parsed.nrels, parsed.xlocators);
407 xact_desc_relations(buf, "rels(abort)", parsed.nabortrels,
408 parsed.abortlocators);
409 xact_desc_stats(buf, "commit ", parsed.nstats, parsed.stats);
410 xact_desc_stats(buf, "abort ", parsed.nabortstats, parsed.abortstats);
411 xact_desc_subxacts(buf, parsed.nsubxacts, parsed.subxacts);
412
414 parsed.tsId, xlrec->initfileinval);
415
416 /*
417 * Check if the replication origin has been set in this record in the same
418 * way as PrepareRedoAdd().
419 */
420 if (origin_id != InvalidReplOriginId)
421 appendStringInfo(buf, "; origin: node %u, lsn %X/%08X, at %s",
422 origin_id,
423 LSN_FORMAT_ARGS(parsed.origin_lsn),
424 timestamptz_to_str(parsed.origin_timestamp));
425}
#define InvalidReplOriginId
Definition origin.h:33
void ParsePrepareRecord(uint8 info, xl_xact_prepare *xlrec, xl_xact_parsed_prepare *parsed)
Definition xactdesc.c:239

References appendStringInfo(), appendStringInfoString(), buf, fb(), InvalidReplOriginId, LSN_FORMAT_ARGS, ParsePrepareRecord(), standby_desc_invalidations(), timestamptz_to_str(), xact_desc_relations(), xact_desc_stats(), and xact_desc_subxacts().

Referenced by xact_desc().

◆ xact_desc_relations()

static void xact_desc_relations ( StringInfo  buf,
char label,
int  nrels,
RelFileLocator xlocators 
)
static

Definition at line 282 of file xactdesc.c.

284{
285 int i;
286
287 if (nrels > 0)
288 {
289 appendStringInfo(buf, "; %s:", label);
290 for (i = 0; i < nrels; i++)
291 {
292 appendStringInfo(buf, " %s",
293 relpathperm(xlocators[i], MAIN_FORKNUM).str);
294 }
295 }
296}
const char * str
static char * label
@ MAIN_FORKNUM
Definition relpath.h:58
#define relpathperm(rlocator, forknum)
Definition relpath.h:146

References appendStringInfo(), buf, i, label, MAIN_FORKNUM, relpathperm, and str.

Referenced by xact_desc_abort(), xact_desc_commit(), and xact_desc_prepare().

◆ xact_desc_stats()

static void xact_desc_stats ( StringInfo  buf,
const char label,
int  ndropped,
xl_xact_stats_item dropped_stats 
)
static

Definition at line 312 of file xactdesc.c.

314{
315 int i;
316
317 if (ndropped > 0)
318 {
319 appendStringInfo(buf, "; %sdropped stats:", label);
320 for (i = 0; i < ndropped; i++)
321 {
322 uint64 objid =
323 ((uint64) dropped_stats[i].objid_hi) << 32 | dropped_stats[i].objid_lo;
324
325 appendStringInfo(buf, " %d/%u/%" PRIu64,
326 dropped_stats[i].kind,
327 dropped_stats[i].dboid,
328 objid);
329 }
330 }
331}
uint64_t uint64
Definition c.h:547

References appendStringInfo(), buf, fb(), i, and label.

Referenced by xact_desc_abort(), xact_desc_commit(), and xact_desc_prepare().

◆ xact_desc_subxacts()

static void xact_desc_subxacts ( StringInfo  buf,
int  nsubxacts,
TransactionId subxacts 
)
static

Definition at line 299 of file xactdesc.c.

300{
301 int i;
302
303 if (nsubxacts > 0)
304 {
305 appendStringInfoString(buf, "; subxacts:");
306 for (i = 0; i < nsubxacts; i++)
307 appendStringInfo(buf, " %u", subxacts[i]);
308 }
309}

References appendStringInfo(), appendStringInfoString(), buf, and i.

Referenced by xact_desc_abort(), xact_desc_commit(), and xact_desc_prepare().

◆ xact_identify()

const char * xact_identify ( uint8  info)

Definition at line 487 of file xactdesc.c.

488{
489 const char *id = NULL;
490
491 switch (info & XLOG_XACT_OPMASK)
492 {
493 case XLOG_XACT_COMMIT:
494 id = "COMMIT";
495 break;
497 id = "PREPARE";
498 break;
499 case XLOG_XACT_ABORT:
500 id = "ABORT";
501 break;
503 id = "COMMIT_PREPARED";
504 break;
506 id = "ABORT_PREPARED";
507 break;
509 id = "ASSIGNMENT";
510 break;
512 id = "INVALIDATION";
513 break;
514 }
515
516 return id;
517}

References fb(), XLOG_XACT_ABORT, XLOG_XACT_ABORT_PREPARED, XLOG_XACT_ASSIGNMENT, XLOG_XACT_COMMIT, XLOG_XACT_COMMIT_PREPARED, XLOG_XACT_INVALIDATIONS, XLOG_XACT_OPMASK, and XLOG_XACT_PREPARE.