PostgreSQL Source Code  git master
xactdesc.c File Reference
#include "postgres.h"
#include "access/transam.h"
#include "access/xact.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)
 
static void xact_desc_commit (StringInfo buf, uint8 info, xl_xact_commit *xlrec, RepOriginId origin_id)
 
static void xact_desc_abort (StringInfo buf, uint8 info, xl_xact_abort *xlrec)
 
static void xact_desc_assignment (StringInfo buf, xl_xact_assignment *xlrec)
 
void xact_desc (StringInfo buf, XLogReaderState *record)
 
const char * xact_identify (uint8 info)
 

Function Documentation

◆ ParseAbortRecord()

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

Definition at line 129 of file xactdesc.c.

References xl_xact_dbinfo::dbId, xl_xact_parsed_abort::dbId, MinSizeOfXactAbort, MinSizeOfXactRelfilenodes, MinSizeOfXactSubxacts, xl_xact_relfilenodes::nrels, xl_xact_parsed_abort::nrels, xl_xact_subxacts::nsubxacts, xl_xact_parsed_abort::nsubxacts, xl_xact_origin::origin_lsn, xl_xact_parsed_abort::origin_lsn, xl_xact_origin::origin_timestamp, xl_xact_parsed_abort::origin_timestamp, strlcpy(), xl_xact_subxacts::subxacts, xl_xact_parsed_abort::subxacts, xl_xact_dbinfo::tsId, xl_xact_parsed_abort::tsId, xl_xact_parsed_abort::twophase_gid, xl_xact_parsed_abort::twophase_xid, xl_xact_abort::xact_time, xl_xact_parsed_abort::xact_time, XACT_XINFO_HAS_DBINFO, XACT_XINFO_HAS_GID, XACT_XINFO_HAS_ORIGIN, XACT_XINFO_HAS_RELFILENODES, XACT_XINFO_HAS_SUBXACTS, XACT_XINFO_HAS_TWOPHASE, xl_xact_twophase::xid, xl_xact_xinfo::xinfo, xl_xact_parsed_abort::xinfo, XLOG_XACT_HAS_INFO, xl_xact_relfilenodes::xnodes, and xl_xact_parsed_abort::xnodes.

Referenced by DecodeXactOp(), recoveryStopsAfter(), recoveryStopsBefore(), xact_desc_abort(), and xact_redo().

130 {
131  char *data = ((char *) xlrec) + MinSizeOfXactAbort;
132 
133  memset(parsed, 0, sizeof(*parsed));
134 
135  parsed->xinfo = 0; /* default, if no XLOG_XACT_HAS_INFO is
136  * present */
137 
138  parsed->xact_time = xlrec->xact_time;
139 
140  if (info & XLOG_XACT_HAS_INFO)
141  {
142  xl_xact_xinfo *xl_xinfo = (xl_xact_xinfo *) data;
143 
144  parsed->xinfo = xl_xinfo->xinfo;
145 
146  data += sizeof(xl_xact_xinfo);
147  }
148 
149  if (parsed->xinfo & XACT_XINFO_HAS_DBINFO)
150  {
151  xl_xact_dbinfo *xl_dbinfo = (xl_xact_dbinfo *) data;
152 
153  parsed->dbId = xl_dbinfo->dbId;
154  parsed->tsId = xl_dbinfo->tsId;
155 
156  data += sizeof(xl_xact_dbinfo);
157  }
158 
159  if (parsed->xinfo & XACT_XINFO_HAS_SUBXACTS)
160  {
161  xl_xact_subxacts *xl_subxacts = (xl_xact_subxacts *) data;
162 
163  parsed->nsubxacts = xl_subxacts->nsubxacts;
164  parsed->subxacts = xl_subxacts->subxacts;
165 
166  data += MinSizeOfXactSubxacts;
167  data += parsed->nsubxacts * sizeof(TransactionId);
168  }
169 
170  if (parsed->xinfo & XACT_XINFO_HAS_RELFILENODES)
171  {
172  xl_xact_relfilenodes *xl_relfilenodes = (xl_xact_relfilenodes *) data;
173 
174  parsed->nrels = xl_relfilenodes->nrels;
175  parsed->xnodes = xl_relfilenodes->xnodes;
176 
178  data += xl_relfilenodes->nrels * sizeof(RelFileNode);
179  }
180 
181  if (parsed->xinfo & XACT_XINFO_HAS_TWOPHASE)
182  {
183  xl_xact_twophase *xl_twophase = (xl_xact_twophase *) data;
184 
185  parsed->twophase_xid = xl_twophase->xid;
186 
187  data += sizeof(xl_xact_twophase);
188 
189  if (parsed->xinfo & XACT_XINFO_HAS_GID)
190  {
191  strlcpy(parsed->twophase_gid, data, sizeof(parsed->twophase_gid));
192  data += strlen(data) + 1;
193  }
194  }
195 
196  /* Note: no alignment is guaranteed after this point */
197 
198  if (parsed->xinfo & XACT_XINFO_HAS_ORIGIN)
199  {
200  xl_xact_origin xl_origin;
201 
202  /* no alignment is guaranteed, so copy onto stack */
203  memcpy(&xl_origin, data, sizeof(xl_origin));
204 
205  parsed->origin_lsn = xl_origin.origin_lsn;
206  parsed->origin_timestamp = xl_origin.origin_timestamp;
207 
208  data += sizeof(xl_xact_origin);
209  }
210 }
#define XACT_XINFO_HAS_ORIGIN
Definition: xact.h:164
struct xl_xact_xinfo xl_xact_xinfo
uint32 TransactionId
Definition: c.h:474
TransactionId xid
Definition: xact.h:253
#define MinSizeOfXactAbort
Definition: xact.h:290
#define XLOG_XACT_HAS_INFO
Definition: xact.h:153
#define XACT_XINFO_HAS_SUBXACTS
Definition: xact.h:160
struct xl_xact_dbinfo xl_xact_dbinfo
#define MinSizeOfXactRelfilenodes
Definition: xact.h:242
TimestampTz xact_time
Definition: xact.h:279
Oid tsId
Definition: xact.h:227
struct xl_xact_origin xl_xact_origin
RelFileNode xnodes[FLEXIBLE_ARRAY_MEMBER]
Definition: xact.h:240
#define MinSizeOfXactSubxacts
Definition: xact.h:235
struct RelFileNode RelFileNode
struct xl_xact_twophase xl_xact_twophase
#define XACT_XINFO_HAS_DBINFO
Definition: xact.h:159
XLogRecPtr origin_lsn
Definition: xact.h:258
TransactionId * subxacts
Definition: xact.h:334
uint32 xinfo
Definition: xact.h:221
XLogRecPtr origin_lsn
Definition: xact.h:342
RelFileNode * xnodes
Definition: xact.h:337
int nsubxacts
Definition: xact.h:232
#define XACT_XINFO_HAS_TWOPHASE
Definition: xact.h:163
Oid dbId
Definition: xact.h:226
TransactionId twophase_xid
Definition: xact.h:339
size_t strlcpy(char *dst, const char *src, size_t siz)
Definition: strlcpy.c:45
TimestampTz xact_time
Definition: xact.h:327
TimestampTz origin_timestamp
Definition: xact.h:259
#define XACT_XINFO_HAS_RELFILENODES
Definition: xact.h:161
TimestampTz origin_timestamp
Definition: xact.h:343
#define XACT_XINFO_HAS_GID
Definition: xact.h:166
char twophase_gid[GIDSIZE]
Definition: xact.h:340
TransactionId subxacts[FLEXIBLE_ARRAY_MEMBER]
Definition: xact.h:233

◆ ParseCommitRecord()

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

Definition at line 34 of file xactdesc.c.

References xl_xact_dbinfo::dbId, xl_xact_parsed_commit::dbId, MinSizeOfXactCommit, MinSizeOfXactInvals, MinSizeOfXactRelfilenodes, MinSizeOfXactSubxacts, xl_xact_invals::msgs, xl_xact_parsed_commit::msgs, xl_xact_invals::nmsgs, xl_xact_parsed_commit::nmsgs, xl_xact_relfilenodes::nrels, xl_xact_parsed_commit::nrels, xl_xact_subxacts::nsubxacts, xl_xact_parsed_commit::nsubxacts, xl_xact_origin::origin_lsn, xl_xact_parsed_commit::origin_lsn, xl_xact_origin::origin_timestamp, xl_xact_parsed_commit::origin_timestamp, strlcpy(), xl_xact_subxacts::subxacts, xl_xact_parsed_commit::subxacts, xl_xact_dbinfo::tsId, xl_xact_parsed_commit::tsId, xl_xact_parsed_commit::twophase_gid, xl_xact_parsed_commit::twophase_xid, xl_xact_commit::xact_time, xl_xact_parsed_commit::xact_time, XACT_XINFO_HAS_DBINFO, XACT_XINFO_HAS_GID, XACT_XINFO_HAS_INVALS, XACT_XINFO_HAS_ORIGIN, XACT_XINFO_HAS_RELFILENODES, XACT_XINFO_HAS_SUBXACTS, XACT_XINFO_HAS_TWOPHASE, xl_xact_twophase::xid, xl_xact_xinfo::xinfo, xl_xact_parsed_commit::xinfo, XLOG_XACT_HAS_INFO, xl_xact_relfilenodes::xnodes, and xl_xact_parsed_commit::xnodes.

Referenced by DecodeXactOp(), recoveryStopsAfter(), recoveryStopsBefore(), xact_desc_commit(), and xact_redo().

35 {
36  char *data = ((char *) xlrec) + MinSizeOfXactCommit;
37 
38  memset(parsed, 0, sizeof(*parsed));
39 
40  parsed->xinfo = 0; /* default, if no XLOG_XACT_HAS_INFO is
41  * present */
42 
43  parsed->xact_time = xlrec->xact_time;
44 
45  if (info & XLOG_XACT_HAS_INFO)
46  {
47  xl_xact_xinfo *xl_xinfo = (xl_xact_xinfo *) data;
48 
49  parsed->xinfo = xl_xinfo->xinfo;
50 
51  data += sizeof(xl_xact_xinfo);
52  }
53 
54  if (parsed->xinfo & XACT_XINFO_HAS_DBINFO)
55  {
56  xl_xact_dbinfo *xl_dbinfo = (xl_xact_dbinfo *) data;
57 
58  parsed->dbId = xl_dbinfo->dbId;
59  parsed->tsId = xl_dbinfo->tsId;
60 
61  data += sizeof(xl_xact_dbinfo);
62  }
63 
64  if (parsed->xinfo & XACT_XINFO_HAS_SUBXACTS)
65  {
66  xl_xact_subxacts *xl_subxacts = (xl_xact_subxacts *) data;
67 
68  parsed->nsubxacts = xl_subxacts->nsubxacts;
69  parsed->subxacts = xl_subxacts->subxacts;
70 
71  data += MinSizeOfXactSubxacts;
72  data += parsed->nsubxacts * sizeof(TransactionId);
73  }
74 
75  if (parsed->xinfo & XACT_XINFO_HAS_RELFILENODES)
76  {
77  xl_xact_relfilenodes *xl_relfilenodes = (xl_xact_relfilenodes *) data;
78 
79  parsed->nrels = xl_relfilenodes->nrels;
80  parsed->xnodes = xl_relfilenodes->xnodes;
81 
83  data += xl_relfilenodes->nrels * sizeof(RelFileNode);
84  }
85 
86  if (parsed->xinfo & XACT_XINFO_HAS_INVALS)
87  {
88  xl_xact_invals *xl_invals = (xl_xact_invals *) data;
89 
90  parsed->nmsgs = xl_invals->nmsgs;
91  parsed->msgs = xl_invals->msgs;
92 
93  data += MinSizeOfXactInvals;
94  data += xl_invals->nmsgs * sizeof(SharedInvalidationMessage);
95  }
96 
97  if (parsed->xinfo & XACT_XINFO_HAS_TWOPHASE)
98  {
99  xl_xact_twophase *xl_twophase = (xl_xact_twophase *) data;
100 
101  parsed->twophase_xid = xl_twophase->xid;
102 
103  data += sizeof(xl_xact_twophase);
104 
105  if (parsed->xinfo & XACT_XINFO_HAS_GID)
106  {
107  strlcpy(parsed->twophase_gid, data, sizeof(parsed->twophase_gid));
108  data += strlen(data) + 1;
109  }
110  }
111 
112  /* Note: no alignment is guaranteed after this point */
113 
114  if (parsed->xinfo & XACT_XINFO_HAS_ORIGIN)
115  {
116  xl_xact_origin xl_origin;
117 
118  /* no alignment is guaranteed, so copy onto stack */
119  memcpy(&xl_origin, data, sizeof(xl_origin));
120 
121  parsed->origin_lsn = xl_origin.origin_lsn;
122  parsed->origin_timestamp = xl_origin.origin_timestamp;
123 
124  data += sizeof(xl_xact_origin);
125  }
126 }
RelFileNode * xnodes
Definition: xact.h:309
#define XACT_XINFO_HAS_ORIGIN
Definition: xact.h:164
struct xl_xact_xinfo xl_xact_xinfo
uint32 TransactionId
Definition: c.h:474
TimestampTz origin_timestamp
Definition: xact.h:320
TransactionId xid
Definition: xact.h:253
TransactionId twophase_xid
Definition: xact.h:314
TransactionId * subxacts
Definition: xact.h:306
#define XLOG_XACT_HAS_INFO
Definition: xact.h:153
SharedInvalidationMessage * msgs
Definition: xact.h:312
XLogRecPtr origin_lsn
Definition: xact.h:319
#define XACT_XINFO_HAS_SUBXACTS
Definition: xact.h:160
struct xl_xact_dbinfo xl_xact_dbinfo
#define MinSizeOfXactRelfilenodes
Definition: xact.h:242
Oid tsId
Definition: xact.h:227
struct xl_xact_origin xl_xact_origin
RelFileNode xnodes[FLEXIBLE_ARRAY_MEMBER]
Definition: xact.h:240
#define MinSizeOfXactSubxacts
Definition: xact.h:235
#define MinSizeOfXactCommit
Definition: xact.h:275
SharedInvalidationMessage msgs[FLEXIBLE_ARRAY_MEMBER]
Definition: xact.h:247
struct RelFileNode RelFileNode
TimestampTz xact_time
Definition: xact.h:264
struct xl_xact_twophase xl_xact_twophase
#define MinSizeOfXactInvals
Definition: xact.h:249
#define XACT_XINFO_HAS_DBINFO
Definition: xact.h:159
XLogRecPtr origin_lsn
Definition: xact.h:258
uint32 xinfo
Definition: xact.h:221
int nsubxacts
Definition: xact.h:232
#define XACT_XINFO_HAS_TWOPHASE
Definition: xact.h:163
Oid dbId
Definition: xact.h:226
size_t strlcpy(char *dst, const char *src, size_t siz)
Definition: strlcpy.c:45
TimestampTz origin_timestamp
Definition: xact.h:259
#define XACT_XINFO_HAS_INVALS
Definition: xact.h:162
#define XACT_XINFO_HAS_RELFILENODES
Definition: xact.h:161
int nmsgs
Definition: xact.h:246
#define XACT_XINFO_HAS_GID
Definition: xact.h:166
char twophase_gid[GIDSIZE]
Definition: xact.h:315
TransactionId subxacts[FLEXIBLE_ARRAY_MEMBER]
Definition: xact.h:233
TimestampTz xact_time
Definition: xact.h:299

◆ xact_desc()

void xact_desc ( StringInfo  buf,
XLogReaderState record 
)

Definition at line 308 of file xactdesc.c.

References appendStringInfo(), xact_desc_abort(), xact_desc_assignment(), xact_desc_commit(), XLOG_XACT_ABORT, XLOG_XACT_ABORT_PREPARED, XLOG_XACT_ASSIGNMENT, XLOG_XACT_COMMIT, XLOG_XACT_COMMIT_PREPARED, XLOG_XACT_OPMASK, XLogRecGetData, XLogRecGetInfo, XLogRecGetOrigin, and xl_xact_assignment::xtop.

309 {
310  char *rec = XLogRecGetData(record);
311  uint8 info = XLogRecGetInfo(record) & XLOG_XACT_OPMASK;
312 
313  if (info == XLOG_XACT_COMMIT || info == XLOG_XACT_COMMIT_PREPARED)
314  {
315  xl_xact_commit *xlrec = (xl_xact_commit *) rec;
316 
317  xact_desc_commit(buf, XLogRecGetInfo(record), xlrec,
318  XLogRecGetOrigin(record));
319  }
320  else if (info == XLOG_XACT_ABORT || info == XLOG_XACT_ABORT_PREPARED)
321  {
322  xl_xact_abort *xlrec = (xl_xact_abort *) rec;
323 
324  xact_desc_abort(buf, XLogRecGetInfo(record), xlrec);
325  }
326  else if (info == XLOG_XACT_ASSIGNMENT)
327  {
328  xl_xact_assignment *xlrec = (xl_xact_assignment *) rec;
329 
330  /*
331  * Note that we ignore the WAL record's xid, since we're more
332  * interested in the top-level xid that issued the record and which
333  * xids are being reported here.
334  */
335  appendStringInfo(buf, "xtop %u: ", xlrec->xtop);
336  xact_desc_assignment(buf, xlrec);
337  }
338 }
#define XLOG_XACT_COMMIT
Definition: xact.h:140
unsigned char uint8
Definition: c.h:323
TransactionId xtop
Definition: xact.h:190
#define XLogRecGetOrigin(decoder)
Definition: xlogreader.h:225
#define XLogRecGetData(decoder)
Definition: xlogreader.h:226
void appendStringInfo(StringInfo str, const char *fmt,...)
Definition: stringinfo.c:78
#define XLOG_XACT_ABORT_PREPARED
Definition: xact.h:144
static void xact_desc_abort(StringInfo buf, uint8 info, xl_xact_abort *xlrec)
Definition: xactdesc.c:264
#define XLogRecGetInfo(decoder)
Definition: xlogreader.h:222
#define XLOG_XACT_ASSIGNMENT
Definition: xact.h:145
#define XLOG_XACT_ABORT
Definition: xact.h:142
#define XLOG_XACT_OPMASK
Definition: xact.h:150
static void xact_desc_assignment(StringInfo buf, xl_xact_assignment *xlrec)
Definition: xactdesc.c:297
#define XLOG_XACT_COMMIT_PREPARED
Definition: xact.h:143
static void xact_desc_commit(StringInfo buf, uint8 info, xl_xact_commit *xlrec, RepOriginId origin_id)
Definition: xactdesc.c:213

◆ xact_desc_abort()

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

Definition at line 264 of file xactdesc.c.

References appendStringInfo(), appendStringInfoString(), i, MAIN_FORKNUM, xl_xact_parsed_abort::nrels, xl_xact_parsed_abort::nsubxacts, ParseAbortRecord(), pfree(), relpathperm, xl_xact_parsed_abort::subxacts, timestamptz_to_str(), TransactionIdIsValid, xl_xact_parsed_abort::twophase_xid, xl_xact_abort::xact_time, and xl_xact_parsed_abort::xnodes.

Referenced by xact_desc().

265 {
266  xl_xact_parsed_abort parsed;
267  int i;
268 
269  ParseAbortRecord(info, xlrec, &parsed);
270 
271  /* If this is a prepared xact, show the xid of the original xact */
273  appendStringInfo(buf, "%u: ", parsed.twophase_xid);
274 
276  if (parsed.nrels > 0)
277  {
278  appendStringInfoString(buf, "; rels:");
279  for (i = 0; i < parsed.nrels; i++)
280  {
281  char *path = relpathperm(parsed.xnodes[i], MAIN_FORKNUM);
282 
283  appendStringInfo(buf, " %s", path);
284  pfree(path);
285  }
286  }
287 
288  if (parsed.nsubxacts > 0)
289  {
290  appendStringInfoString(buf, "; subxacts:");
291  for (i = 0; i < parsed.nsubxacts; i++)
292  appendStringInfo(buf, " %u", parsed.subxacts[i]);
293  }
294 }
#define relpathperm(rnode, forknum)
Definition: relpath.h:83
TimestampTz xact_time
Definition: xact.h:279
void pfree(void *pointer)
Definition: mcxt.c:1031
void appendStringInfo(StringInfo str, const char *fmt,...)
Definition: stringinfo.c:78
void appendStringInfoString(StringInfo str, const char *s)
Definition: stringinfo.c:157
TransactionId * subxacts
Definition: xact.h:334
RelFileNode * xnodes
Definition: xact.h:337
TransactionId twophase_xid
Definition: xact.h:339
void ParseAbortRecord(uint8 info, xl_xact_abort *xlrec, xl_xact_parsed_abort *parsed)
Definition: xactdesc.c:129
int i
#define TransactionIdIsValid(xid)
Definition: transam.h:41
const char * timestamptz_to_str(TimestampTz t)
Definition: timestamp.c:1710

◆ xact_desc_assignment()

static void xact_desc_assignment ( StringInfo  buf,
xl_xact_assignment xlrec 
)
static

Definition at line 297 of file xactdesc.c.

References appendStringInfo(), appendStringInfoString(), i, xl_xact_assignment::nsubxacts, and xl_xact_assignment::xsub.

Referenced by xact_desc().

298 {
299  int i;
300 
301  appendStringInfoString(buf, "subxacts:");
302 
303  for (i = 0; i < xlrec->nsubxacts; i++)
304  appendStringInfo(buf, " %u", xlrec->xsub[i]);
305 }
TransactionId xsub[FLEXIBLE_ARRAY_MEMBER]
Definition: xact.h:192
void appendStringInfo(StringInfo str, const char *fmt,...)
Definition: stringinfo.c:78
void appendStringInfoString(StringInfo str, const char *s)
Definition: stringinfo.c:157
int i

◆ xact_desc_commit()

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

Definition at line 213 of file xactdesc.c.

References appendStringInfo(), appendStringInfoString(), xl_xact_parsed_commit::dbId, i, MAIN_FORKNUM, xl_xact_parsed_commit::msgs, xl_xact_parsed_commit::nmsgs, xl_xact_parsed_commit::nrels, xl_xact_parsed_commit::nsubxacts, xl_xact_parsed_commit::origin_lsn, xl_xact_parsed_commit::origin_timestamp, ParseCommitRecord(), pfree(), relpathperm, standby_desc_invalidations(), xl_xact_parsed_commit::subxacts, timestamptz_to_str(), TransactionIdIsValid, xl_xact_parsed_commit::tsId, xl_xact_parsed_commit::twophase_xid, xl_xact_commit::xact_time, XACT_XINFO_HAS_ORIGIN, XactCompletionForceSyncCommit, XactCompletionRelcacheInitFileInval, xl_xact_parsed_commit::xinfo, and xl_xact_parsed_commit::xnodes.

Referenced by xact_desc().

214 {
215  xl_xact_parsed_commit parsed;
216  int i;
217 
218  ParseCommitRecord(info, xlrec, &parsed);
219 
220  /* If this is a prepared xact, show the xid of the original xact */
222  appendStringInfo(buf, "%u: ", parsed.twophase_xid);
223 
225 
226  if (parsed.nrels > 0)
227  {
228  appendStringInfoString(buf, "; rels:");
229  for (i = 0; i < parsed.nrels; i++)
230  {
231  char *path = relpathperm(parsed.xnodes[i], MAIN_FORKNUM);
232 
233  appendStringInfo(buf, " %s", path);
234  pfree(path);
235  }
236  }
237  if (parsed.nsubxacts > 0)
238  {
239  appendStringInfoString(buf, "; subxacts:");
240  for (i = 0; i < parsed.nsubxacts; i++)
241  appendStringInfo(buf, " %u", parsed.subxacts[i]);
242  }
243  if (parsed.nmsgs > 0)
244  {
246  buf, parsed.nmsgs, parsed.msgs, parsed.dbId, parsed.tsId,
248  }
249 
251  appendStringInfoString(buf, "; sync");
252 
253  if (parsed.xinfo & XACT_XINFO_HAS_ORIGIN)
254  {
255  appendStringInfo(buf, "; origin: node %u, lsn %X/%X, at %s",
256  origin_id,
257  (uint32) (parsed.origin_lsn >> 32),
258  (uint32) parsed.origin_lsn,
260  }
261 }
RelFileNode * xnodes
Definition: xact.h:309
#define relpathperm(rnode, forknum)
Definition: relpath.h:83
#define XACT_XINFO_HAS_ORIGIN
Definition: xact.h:164
#define XactCompletionRelcacheInitFileInval(xinfo)
Definition: xact.h:183
void standby_desc_invalidations(StringInfo buf, int nmsgs, SharedInvalidationMessage *msgs, Oid dbId, Oid tsId, bool relcacheInitFileInval)
Definition: standbydesc.c:98
TimestampTz origin_timestamp
Definition: xact.h:320
TransactionId twophase_xid
Definition: xact.h:314
TransactionId * subxacts
Definition: xact.h:306
SharedInvalidationMessage * msgs
Definition: xact.h:312
XLogRecPtr origin_lsn
Definition: xact.h:319
void pfree(void *pointer)
Definition: mcxt.c:1031
void appendStringInfo(StringInfo str, const char *fmt,...)
Definition: stringinfo.c:78
void appendStringInfoString(StringInfo str, const char *s)
Definition: stringinfo.c:157
void ParseCommitRecord(uint8 info, xl_xact_commit *xlrec, xl_xact_parsed_commit *parsed)
Definition: xactdesc.c:34
TimestampTz xact_time
Definition: xact.h:264
unsigned int uint32
Definition: c.h:325
#define XactCompletionForceSyncCommit(xinfo)
Definition: xact.h:185
int i
#define TransactionIdIsValid(xid)
Definition: transam.h:41
const char * timestamptz_to_str(TimestampTz t)
Definition: timestamp.c:1710

◆ xact_identify()

const char* xact_identify ( uint8  info)

Definition at line 341 of file xactdesc.c.

References XLOG_XACT_ABORT, XLOG_XACT_ABORT_PREPARED, XLOG_XACT_ASSIGNMENT, XLOG_XACT_COMMIT, XLOG_XACT_COMMIT_PREPARED, XLOG_XACT_OPMASK, and XLOG_XACT_PREPARE.

342 {
343  const char *id = NULL;
344 
345  switch (info & XLOG_XACT_OPMASK)
346  {
347  case XLOG_XACT_COMMIT:
348  id = "COMMIT";
349  break;
350  case XLOG_XACT_PREPARE:
351  id = "PREPARE";
352  break;
353  case XLOG_XACT_ABORT:
354  id = "ABORT";
355  break;
357  id = "COMMIT_PREPARED";
358  break;
360  id = "ABORT_PREPARED";
361  break;
363  id = "ASSIGNMENT";
364  break;
365  }
366 
367  return id;
368 }
#define XLOG_XACT_COMMIT
Definition: xact.h:140
#define XLOG_XACT_PREPARE
Definition: xact.h:141
#define XLOG_XACT_ABORT_PREPARED
Definition: xact.h:144
#define XLOG_XACT_ASSIGNMENT
Definition: xact.h:145
#define XLOG_XACT_ABORT
Definition: xact.h:142
#define XLOG_XACT_OPMASK
Definition: xact.h:150
#define XLOG_XACT_COMMIT_PREPARED
Definition: xact.h:143