apache / apache/doris-flink-connector
[Bug] sink csv格式 启用gz压缩批量写入doris 会发生卡住 计数器释放错误
- Dominant language
- Java
- Stars
- 385
- Forks
- 279
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 6
Description
### Search before asking
- [x] I had searched in the [issues](https://github.com/apache/incubator-doris/issues?q=is%3Aissue) and found no similar issues.
### Version
25.1.0
### What's Wrong?
csv格式启用gz压缩选项 运行一定时间后会发生卡死
2025-09-09 15:54:51,372 INFO org.apache.doris.flink.sink.batch.DorisBatchStreamLoad [] - Cache full, waiting for flush, currentBytes: 314572855, maxBlockedBytes: 314572800
2025-09-09 15:54:52,335 INFO org.apache.doris.flink.sink.batch.DorisBatchStreamLoad [] - bufferMap is empty, no need to flush null
2025-09-09 15:54:52,372 INFO org.apache.doris.flink.sink.batch.DorisBatchStreamLoad [] - Cache full, waiting for flush, currentBytes: 314572855, maxBlockedBytes: 314572800
2025-09-09 15:54:53,372 INFO org.apache.doris.flink.sink.batch.DorisBatchStreamLoad [] - Cache full, waiting for flush, currentBytes: 314572855, maxBlockedBytes: 314572800
2025-09-09 15:54:54,335 INFO org.apache.doris.flink.sink.batch.DorisBatchStreamLoad [] - bufferMap is empty, no need to flush null
2025-09-09 15:54:54,373 INFO org.apache.doris.flink.sink.batch.DorisBatchStreamLoad [] - Cache full, waiting for flush, currentBytes: 314572855, maxBlockedBytes: 314572800
我的配置是
Properties props = new Properties();
props.setProperty("column_separator", ",");
props.setProperty("line_delimiter", "\n");
props.setProperty("format", "csv");
props.setProperty("compress_type", "gz");
return DorisExecutionOptions.builder()
.setLabelPrefix(tableName + "-" + System.currentTimeMillis())
.setDeletable(false)
.setBatchMode(true)
.setBufferFlushMaxRows(20000)
.setBufferFlushIntervalMs(2000)
.setStreamLoadProp(props)
.build();
查看源码后猜想
记录cacheBeforeFlushBytes是压缩前的大小
发送数据后
currentCacheBytes.getAndAdd(-respContent.getLoadBytes()); 是压缩后的大小
导致数值不释放
然后发生问题Cache full, waiting for flush
一直在lock状态
### What You Expected?
期望解决该bug
### How to Reproduce?
_No response_
### Anything Else?
_No response_
### Are you willing to submit PR?
- [x] Yes I am willing to submit a PR!
### Code of Conduct
- [x] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
Contributor guide
Research direction
Start in org.apache.doris.flink.sink.batch.DorisBatchStreamLoad and trace cacheBeforeFlushBytes through currentCacheBytes.getAndAdd(-respContent.getLoadBytes()) during CSV gzip batch loading. Reproduce with the provided DorisExecutionOptions and stream-load properties, then verify that cache accounting is released consistently and the sink no longer remains stuck at “Cache full, waiting for flush.”
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- data-engineering
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100