Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions sources/pg_replication/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -705,6 +705,8 @@ def process_msg(self, msg: ReplicationMessage) -> None:
"The truncate operation is currently not supported. "
"Truncate replication messages are ignored."
)
elif op == 89: # ASCII for 'Y'
pass # Type messages describe custom types and do not carry row changes.
else:
raise ValueError(f"Unknown replication op {op}")

Expand Down
11 changes: 11 additions & 0 deletions tests/pg_replication/test_pg_replication.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import pytest

from types import SimpleNamespace
from typing import Set, Tuple
from copy import deepcopy
from psycopg2.errors import InsufficientPrivilege
Expand All @@ -15,6 +16,7 @@
)
from sources.pg_replication import replication_resource
from sources.pg_replication.helpers import (
MessageConsumer,
init_replication,
get_pg_version,
)
Expand All @@ -24,6 +26,15 @@
from .utils import add_pk, assert_loaded_data, is_super_user


def test_message_consumer_ignores_type_message() -> None:
consumer = MessageConsumer(upto_lsn=0, pub_ops={})

consumer.process_msg(SimpleNamespace(payload=b"Y")) # type: ignore[arg-type]

assert consumer.data_items == {}
assert consumer.consumed_all is False


@pytest.mark.parametrize("destination_name", ALL_DESTINATIONS)
def test_schema_replication(
src_config: Tuple[dlt.Pipeline, str, str], destination_name: str
Expand Down