【发布时间】:2021-09-25 12:16:01
【问题描述】:
我正在使用带有 JDBC 驱动程序的 JDBC 源连接器来收集从 Google Cloud Spanner 到 Kafka 的数据。 我在桌子上使用“时间戳+递增”模式。表的主键包括 2 列(order_item_id 和 order_id)。 我使用 order_item_id 作为递增列,使用名为“updated_time”的列作为时间戳列。
当我启动连接器时,有时会出现以下错误,但我最终仍然可以获取数据。
ERROR Failed to run query for table TimestampIncrementingTableQuerier{table="order_item", query='null',
topicPrefix='test_', incrementingColumn='order_item_id', timestampColumns=[updated_time]}: {}
(io.confluent.connect.jdbc.source.JdbcSourceTask:404)
com.google.cloud.spanner.jdbc.JdbcSqlExceptionFactory$JdbcAbortedDueToConcurrentModificationException:
The transaction was aborted and could not be retried due to a concurrent modification
...
Caused by: com.google.cloud.spanner.AbortedDueToConcurrentModificationException:
The transaction was aborted and could not be retried due to a concurrent modification
...
Suppressed: com.google.cloud.spanner.connection.AbstractBaseUnitOfWork$SpannerAsyncExecutionException:
Execution failed for statement:
SELECT * FROM `order_item` WHERE `order_item`.`updated_time` < @p1 AND ((`order_item`.`updated_time` = @p2 AND `order_item`.`order_item_id` > @p3) OR `order_item`.`updated_time` > @p4) ORDER BY `order_item`.`updated_time`,`order_item`.`order_item_id` ASC
...
Caused by: com.google.cloud.spanner.AbortedException: ABORTED: io.grpc.StatusRuntimeException:
ABORTED: Transaction was aborted. It was wounded by a higher priority transaction due to conflict on keys in range [[5587892845991837697,5587892845991837702], [5587892845991837697,5587892845991837702]), column adjust in table order_item.
retry_delay {
nanos: 12974238
}
- Statement: 'SELECT * FROM `order_item` WHERE `order_item`.`updated_time` < @p1 AND ((`order_item`.`updated_time` = @p2 AND `order_item`.`order_item_id` > @p3) OR `order_item`.`updated_time` > @p4) ORDER BY `order_item`.`updated_time`,`order_item`.`order_item_id` ASC'
...
我想知道在我的情况下这个错误是如何发生的。顺便说一句,即使出现错误,连接器仍然可以在最后收集数据。任何人都可以帮忙吗?非常感谢!
【问题讨论】:
标签: jdbc apache-kafka-connect google-cloud-spanner