summaryrefslogtreecommitdiff
path: root/src/backend/replication/logical/worker.c
diff options
context:
space:
mode:
authorTomas Vondra <tomas.vondra@postgresql.org>2022-04-07 18:13:13 +0200
committerTomas Vondra <tomas.vondra@postgresql.org>2022-04-07 20:06:36 +0200
commit2c7ea57e56ca5f668c32d4266e0a3e45b455bef5 (patch)
treec4b80357147f2212e571dd1a4522c2b73068a783 /src/backend/replication/logical/worker.c
parentd7ab2a9a3c0a2800ab36bb48d1cc97370067777e (diff)
Revert "Logical decoding of sequences"
This reverts a sequence of commits, implementing features related to logical decoding and replication of sequences: - 0da92dc530c9251735fc70b20cd004d9630a1266 - 80901b32913ffa59bf157a4d88284b2b3a7511d9 - b779d7d8fdae088d70da5ed9fcd8205035676df3 - d5ed9da41d96988d905b49bebb273a9b2d6e2915 - a180c2b34de0989269fdb819bff241a249bf5380 - 75b1521dae1ff1fde17fda2e30e591f2e5d64b6a - 2d2232933b02d9396113662e44dca5f120d6830e - 002c9dd97a0c874fd1693a570383e2dd38cd40d5 - 05843b1aa49df2ecc9b97c693b755bd1b6f856a9 The implementation has issues, mostly due to combining transactional and non-transactional behavior of sequences. It's not clear how this could be fixed, but it'll require reworking significant part of the patch. Discussion: https://postgr.es/m/95345a19-d508-63d1-860a-f5c2f41e8d40@enterprisedb.com
Diffstat (limited to 'src/backend/replication/logical/worker.c')
-rw-r--r--src/backend/replication/logical/worker.c56
1 files changed, 0 insertions, 56 deletions
diff --git a/src/backend/replication/logical/worker.c b/src/backend/replication/logical/worker.c
index 7ade49652e7..9181d3e8636 100644
--- a/src/backend/replication/logical/worker.c
+++ b/src/backend/replication/logical/worker.c
@@ -143,7 +143,6 @@
#include "catalog/pg_subscription.h"
#include "catalog/pg_subscription_rel.h"
#include "catalog/pg_tablespace.h"
-#include "commands/sequence.h"
#include "commands/tablecmds.h"
#include "commands/tablespace.h"
#include "commands/trigger.h"
@@ -1145,57 +1144,6 @@ apply_handle_origin(StringInfo s)
}
/*
- * Handle SEQUENCE message.
- */
-static void
-apply_handle_sequence(StringInfo s)
-{
- LogicalRepSequence seq;
- Oid relid;
-
- if (handle_streamed_transaction(LOGICAL_REP_MSG_SEQUENCE, s))
- return;
-
- logicalrep_read_sequence(s, &seq);
-
- /*
- * Non-transactional sequence updates should not be part of a remote
- * transaction. There should not be any running transaction.
- */
- Assert((!seq.transactional) || in_remote_transaction);
- Assert(!(!seq.transactional && in_remote_transaction));
- Assert(!(!seq.transactional && IsTransactionState()));
-
- /*
- * Make sure we're in a transaction (needed by SetSequence). For
- * non-transactional updates we're guaranteed to start a new one,
- * and we'll commit it at the end.
- */
- if (!IsTransactionState())
- {
- StartTransactionCommand();
- maybe_reread_subscription();
- }
-
- relid = RangeVarGetRelid(makeRangeVar(seq.nspname,
- seq.seqname, -1),
- RowExclusiveLock, false);
-
- /* lock the sequence in AccessExclusiveLock, as expected by SetSequence */
- LockRelationOid(relid, AccessExclusiveLock);
-
- /* apply the sequence change */
- SetSequence(relid, seq.transactional, seq.last_value, seq.log_cnt, seq.is_called);
-
- /*
- * Commit the per-stream transaction (we only do this when not in
- * remote transaction, i.e. for non-transactional sequence updates.
- */
- if (!in_remote_transaction)
- CommitTransactionCommand();
-}
-
-/*
* Handle STREAM START message.
*/
static void
@@ -2563,10 +2511,6 @@ apply_dispatch(StringInfo s)
*/
break;
- case LOGICAL_REP_MSG_SEQUENCE:
- apply_handle_sequence(s);
- return;
-
case LOGICAL_REP_MSG_STREAM_START:
apply_handle_stream_start(s);
break;