PostgreSQL Source Code: src/backend/replication/logical/logicalctl.c Source File (original) (raw)
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
65
76
77
78
79
80
81
83{
84
85
86
87
88
89
91
92
94
95
98
100
101
102
103
104
105
106
107
109
110
111
112
113
114
115
116
118
122
128
129void
131{
132 bool found;
133
136 &found);
137
138 if (!found)
140}
141
142
143
144
145
146void
148{
149
151 return;
152
153
154
155
156
157
158
161}
162
163
164
165
166static inline void
171
172
173
174
175
176void
181
182
183
184
185
186bool
188{
190 {
191
193 }
194 else
196
197 return true;
198}
199
200
201
202
203
204bool
206{
207 bool enabled;
208
212
213 return enabled;
214}
215
216
217
218
219
220bool
222{
223 bool xlog_logical_info;
224
228
229 return xlog_logical_info;
230}
231
232
233
234
235void
237{
238
240 {
243 }
244}
245
246
247
248
249
250static void
260
261
262
263
264
265static void
267{
270
271 elog(DEBUG1, "aborting logical decoding activation process");
272
273
274
275
276
280
281
282
283
284
285
286
287
289}
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305void
307{
310
311
313 return;
314
316 {
317
318
319
320
321
323 return;
324 }
325
326
327
328
329
331 {
333 }
335}
336
337
338
339
340void
342{
344
346
347
349 {
352 return;
353 }
354
355
356
357
358
359
361
363
364
365
366
367
368
371
373
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
403
404
405
406
407
408
410
412
415
417
419
421
424 errmsg("logical decoding is enabled upon creating a new logical replication slot"));
425}
426
427
428
429
430
431
432
433void
435{
437 return;
438
439
440
441
442
443
444
448
450
451 elog(DEBUG1, "requested disabling logical decoding");
452}
453
454
455
456
457
458
459
460void
462{
463 bool pending_disable;
464
466 return;
467
468
469
470
471
473
475 return;
476
480
481
482 if (!pending_disable)
483 return;
484
486}
487
488
489
490
491void
493{
495
497
498
499
500
501
502
503
506 {
509 return;
510 }
511
513
514
515
516
517
518
520
521
524
525
528
530
533 errmsg("logical decoding is disabled because there are no valid logical replication slots"));
534
536
537
538
539
540
541
542
543
544
546}
547
548
549
550
551
552
553void
555{
557
559
560
561
562
563
564
566 {
568 return;
569 }
570
572
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
598 {
599
600
601
602
603
604
607
609 "update logical decoding status to %d at the end of recovery",
611
612
613
614
615
616
617
619
621
623 }
624 else
626
627
628
629
630
631
632
633
634
638
639 INJECTION_POINT("startup-logical-decoding-status-change-end-of-recovery", NULL);
640}
#define Assert(condition)
#define MemSet(start, val, len)
void WakeupCheckpointer(void)
#define ereport(elevel,...)
#define INJECTION_POINT(name, arg)
#define PG_ENSURE_ERROR_CLEANUP(cleanup_function, arg)
#define PG_END_ENSURE_ERROR_CLEANUP(cleanup_function, arg)
void InitializeProcessXLogLogicalInfo(void)
void LogicalDecodingCtlShmemInit(void)
void UpdateLogicalDecodingStatusEndOfRecovery(void)
bool IsLogicalDecodingEnabled(void)
void EnsureLogicalDecodingEnabled(void)
Size LogicalDecodingCtlShmemSize(void)
static void abort_logical_decoding_activation(int code, Datum arg)
bool ProcessBarrierUpdateXLogLogicalInfo(void)
static bool XLogLogicalInfoUpdatePending
void AtEOXact_LogicalCtl(void)
static void update_xlog_logical_info(void)
bool IsXLogLogicalInfoEnabled(void)
void StartupLogicalDecodingStatus(bool last_status)
void DisableLogicalDecoding(void)
static LogicalDecodingCtlData * LogicalDecodingCtl
void EnableLogicalDecoding(void)
void RequestDisableLogicalDecoding(void)
static void write_logical_decoding_status_update_record(bool status)
void DisableLogicalDecodingIfNecessary(void)
bool LWLockAcquire(LWLock *lock, LWLockMode mode)
void LWLockRelease(LWLock *lock)
#define START_CRIT_SECTION()
#define END_CRIT_SECTION()
#define XLOG_LOGICAL_DECODING_STATUS_CHANGE
void WaitForProcSignalBarrier(uint64 generation)
uint64 EmitProcSignalBarrier(ProcSignalBarrierType type)
@ PROCSIGNAL_BARRIER_UPDATE_XLOG_LOGICAL_INFO
void * ShmemInitStruct(const char *name, Size size, bool *foundPtr)
bool CheckLogicalSlotExists(void)
ReplicationSlot * MyReplicationSlot
bool logical_decoding_enabled
#define InvalidTransactionId
TransactionId GetTopTransactionIdIfAny(void)
bool RecoveryInProgress(void)
void XLogFlush(XLogRecPtr record)
XLogRecPtr XLogInsert(RmgrId rmid, uint8 info)
void XLogRegisterData(const void *data, uint32 len)
void XLogBeginInsert(void)