@@ -115,6 +115,7 @@ StartupDecodingContext(List *output_plugin_options,
115
115
XLogRecPtr start_lsn ,
116
116
TransactionId xmin_horizon ,
117
117
bool need_full_snapshot ,
118
+ bool fast_forward ,
118
119
XLogPageReadCB read_page ,
119
120
LogicalOutputPluginWriterPrepareWrite prepare_write ,
120
121
LogicalOutputPluginWriterWrite do_write ,
@@ -140,7 +141,8 @@ StartupDecodingContext(List *output_plugin_options,
140
141
* (re-)load output plugins, so we detect a bad (removed) output plugin
141
142
* now.
142
143
*/
143
- LoadOutputPlugin (& ctx -> callbacks , NameStr (slot -> data .plugin ));
144
+ if (!fast_forward )
145
+ LoadOutputPlugin (& ctx -> callbacks , NameStr (slot -> data .plugin ));
144
146
145
147
/*
146
148
* Now that the slot's xmin has been set, we can announce ourselves as a
@@ -191,6 +193,8 @@ StartupDecodingContext(List *output_plugin_options,
191
193
192
194
ctx -> output_plugin_options = output_plugin_options ;
193
195
196
+ ctx -> fast_forward = fast_forward ;
197
+
194
198
MemoryContextSwitchTo (old_context );
195
199
196
200
return ctx ;
@@ -303,8 +307,9 @@ CreateInitDecodingContext(char *plugin,
303
307
ReplicationSlotSave ();
304
308
305
309
ctx = StartupDecodingContext (NIL , InvalidXLogRecPtr , xmin_horizon ,
306
- need_full_snapshot , read_page , prepare_write ,
307
- do_write , update_progress );
310
+ need_full_snapshot , true,
311
+ read_page , prepare_write , do_write ,
312
+ update_progress );
308
313
309
314
/* call output plugin initialization callback */
310
315
old_context = MemoryContextSwitchTo (ctx -> context );
@@ -342,6 +347,7 @@ CreateInitDecodingContext(char *plugin,
342
347
LogicalDecodingContext *
343
348
CreateDecodingContext (XLogRecPtr start_lsn ,
344
349
List * output_plugin_options ,
350
+ bool fast_forward ,
345
351
XLogPageReadCB read_page ,
346
352
LogicalOutputPluginWriterPrepareWrite prepare_write ,
347
353
LogicalOutputPluginWriterWrite do_write ,
@@ -395,8 +401,8 @@ CreateDecodingContext(XLogRecPtr start_lsn,
395
401
396
402
ctx = StartupDecodingContext (output_plugin_options ,
397
403
start_lsn , InvalidTransactionId , false,
398
- read_page , prepare_write , do_write ,
399
- update_progress );
404
+ fast_forward , read_page , prepare_write ,
405
+ do_write , update_progress );
400
406
401
407
/* call output plugin initialization callback */
402
408
old_context = MemoryContextSwitchTo (ctx -> context );
@@ -573,6 +579,8 @@ startup_cb_wrapper(LogicalDecodingContext *ctx, OutputPluginOptions *opt, bool i
573
579
LogicalErrorCallbackState state ;
574
580
ErrorContextCallback errcallback ;
575
581
582
+ Assert (!ctx -> fast_forward );
583
+
576
584
/* Push callback + info on the error context stack */
577
585
state .ctx = ctx ;
578
586
state .callback_name = "startup" ;
@@ -598,6 +606,8 @@ shutdown_cb_wrapper(LogicalDecodingContext *ctx)
598
606
LogicalErrorCallbackState state ;
599
607
ErrorContextCallback errcallback ;
600
608
609
+ Assert (!ctx -> fast_forward );
610
+
601
611
/* Push callback + info on the error context stack */
602
612
state .ctx = ctx ;
603
613
state .callback_name = "shutdown" ;
@@ -629,6 +639,8 @@ begin_cb_wrapper(ReorderBuffer *cache, ReorderBufferTXN *txn)
629
639
LogicalErrorCallbackState state ;
630
640
ErrorContextCallback errcallback ;
631
641
642
+ Assert (!ctx -> fast_forward );
643
+
632
644
/* Push callback + info on the error context stack */
633
645
state .ctx = ctx ;
634
646
state .callback_name = "begin" ;
@@ -658,6 +670,8 @@ commit_cb_wrapper(ReorderBuffer *cache, ReorderBufferTXN *txn,
658
670
LogicalErrorCallbackState state ;
659
671
ErrorContextCallback errcallback ;
660
672
673
+ Assert (!ctx -> fast_forward );
674
+
661
675
/* Push callback + info on the error context stack */
662
676
state .ctx = ctx ;
663
677
state .callback_name = "commit" ;
@@ -687,6 +701,8 @@ change_cb_wrapper(ReorderBuffer *cache, ReorderBufferTXN *txn,
687
701
LogicalErrorCallbackState state ;
688
702
ErrorContextCallback errcallback ;
689
703
704
+ Assert (!ctx -> fast_forward );
705
+
690
706
/* Push callback + info on the error context stack */
691
707
state .ctx = ctx ;
692
708
state .callback_name = "change" ;
@@ -721,6 +737,8 @@ filter_by_origin_cb_wrapper(LogicalDecodingContext *ctx, RepOriginId origin_id)
721
737
ErrorContextCallback errcallback ;
722
738
bool ret ;
723
739
740
+ Assert (!ctx -> fast_forward );
741
+
724
742
/* Push callback + info on the error context stack */
725
743
state .ctx = ctx ;
726
744
state .callback_name = "filter_by_origin" ;
@@ -751,6 +769,8 @@ message_cb_wrapper(ReorderBuffer *cache, ReorderBufferTXN *txn,
751
769
LogicalErrorCallbackState state ;
752
770
ErrorContextCallback errcallback ;
753
771
772
+ Assert (!ctx -> fast_forward );
773
+
754
774
if (ctx -> callbacks .message_cb == NULL )
755
775
return ;
756
776
0 commit comments