@@ -313,7 +313,7 @@ replorigin_create(char *roname)
313
313
if (tuple == NULL )
314
314
ereport (ERROR ,
315
315
(errcode (ERRCODE_PROGRAM_LIMIT_EXCEEDED ),
316
- errmsg ("no free replication oid could be found" )));
316
+ errmsg ("no free replication origin oid could be found" )));
317
317
318
318
heap_freetuple (tuple );
319
319
return roident ;
@@ -375,6 +375,10 @@ replorigin_drop(RepOriginId roident)
375
375
LWLockRelease (ReplicationOriginLock );
376
376
377
377
tuple = SearchSysCache1 (REPLORIGIDENT , ObjectIdGetDatum (roident ));
378
+ if (!HeapTupleIsValid (tuple ))
379
+ elog (ERROR , "cache lookup failed for replication origin with oid %u" ,
380
+ roident );
381
+
378
382
simple_heap_delete (rel , & tuple -> t_self );
379
383
ReleaseSysCache (tuple );
380
384
@@ -437,7 +441,7 @@ ReplicationOriginShmemSize(void)
437
441
Size size = 0 ;
438
442
439
443
/*
440
- * XXX: max_replication_slots is arguablethe wrong thing to use here, here
444
+ * XXX: max_replication_slots is arguably the wrong thing to use, as here
441
445
* we keep the replay state of *remote* transactions. But for now it seems
442
446
* sufficient to reuse it, lest we introduce a separate guc.
443
447
*/
@@ -523,7 +527,7 @@ CheckPointReplicationOrigin(void)
523
527
ereport (PANIC ,
524
528
(errcode_for_file_access (),
525
529
errmsg ("could not remove file \"%s\": %m" ,
526
- path )));
530
+ tmppath )));
527
531
528
532
/*
529
533
* no other backend can perform this at the same time, we're protected by
@@ -799,12 +803,12 @@ replorigin_redo(XLogReaderState *record)
799
803
* Tell the replication origin progress machinery that a commit from 'node'
800
804
* that originated at the LSN remote_commit on the remote node was replayed
801
805
* successfully and that we don't need to do so again. In combination with
802
- * setting up replorigin_sesssion_origin_lsn and replorigin_sesssion_origin that ensures we
803
- * won't loose knowledge about that after a crash if the transaction had a
804
- * persistent effect (think of asynchronous commits).
806
+ * setting up replorigin_sesssion_origin_lsn and replorigin_sesssion_origin
807
+ * that ensures we won't loose knowledge about that after a crash if the
808
+ * transaction had a persistent effect (think of asynchronous commits).
805
809
*
806
810
* local_commit needs to be a local LSN of the commit so that we can make sure
807
- * uppon a checkpoint that enough WAL has been persisted to disk.
811
+ * upon a checkpoint that enough WAL has been persisted to disk.
808
812
*
809
813
* Needs to be called with a RowExclusiveLock on pg_replication_origin,
810
814
* unless running in recovery.
@@ -1249,7 +1253,6 @@ pg_replication_origin_session_reset(PG_FUNCTION_ARGS)
1249
1253
1250
1254
replorigin_session_reset ();
1251
1255
1252
- /* FIXME */
1253
1256
replorigin_sesssion_origin = InvalidRepOriginId ;
1254
1257
replorigin_sesssion_origin_lsn = InvalidXLogRecPtr ;
1255
1258
replorigin_sesssion_origin_timestamp = 0 ;
0 commit comments