-
Bug
-
Resolution: Done
-
Major
-
1.7.1.Final
-
False
-
False
-
-
When I set up a connector to read the contents of a table with a LOB column (I verified this with both BLOB and CLOB), with LOB support enabled in the configuration, I observe the following behavior for medium-sized (5-10MiB) LOBs:
- initial snapshot replication works perfectly; the LOBs are emitted onto the Kafka topic in their entirety
- during streaming replication, LOBs are truncated. Only the last ~300KiB of the LOB appears on the Kafka topic.
I figured out what is going on: the code that processes LOBs (debezium-connector-oracle/src/main/java/io/debezium/connector/oracle/logminer/processor/TransactionCommitConsumer.java) assumes that a LOB value is represented in LogMiner as
- a single SELECT <lob-column> INTO <variable> FOR UPDATE (SEL_LOB_LOCATOR event), followed by
- an unbroken sequence of LOB_WRITE events
When the LOB_WRITE event sequence is interrupted by any other event, the accumulated LOB contents are written to lastEvent's newValues array (mergeLobWriteData).
However, in my reproduction scenario, I see the following behavior from Oracle (19c EE):
- SEL_LOB_LOCATOR for row X, column Y
- a (short) series of LOB_WRITE events
- SEL_LOB_LOCATOR for row X, column Y (so same LOB as the first SEL_LOB_LOCATOR)
- another shortish series of LOB_WRITE events
- ... and so on
Every time the LOB_WRITE series is interrupted with a (spurious) SEL_LOB_LOCATOR, mergeLobWriteData is called, the accumulated bytes are concatenated, and the previous accumulation isĀ overwritten in lastEvent.newValues.
Ultimately, what ends up in the Kafka topics are the bytes from the last unbroken string of LOB_WRITE events, everything prior to that is discarded.
- is related to
-
DBZ-4321 Explore BLOB support via re-selection
- Closed
-
DBZ-4650 Mark incompatible Xstream tests as LogMiner only
- Closed
-
DBZ-4716 Document that Oracle Xstream emits DBMS_LOB method calls as separate events
- Closed
-
DBZ-4741 Unify Xstream behavior with LogMiner when using DBMS_LOB methods
- Open