apache / apache/paimon

[Bug] set consumner-id, but still error with "snapshot with id has expired."

Open
#5,819 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Java
Stars
3.4k
Forks
1.4k
Avg merge
1d 11h
Merged PRs (30d)
396

Description

### Search before asking

- [x] I searched in the [issues](https://github.com/apache/paimon/issues) and found nothing similar.

### Paimon version

paimon 1.0.1

### Compute Engine

flink 1.18

### Minimal reproduce step

i have a dedicated compaction with consumer_id, but sometimes i still have error "org.apache.paimon.table.source.OutOfRangeException: The snapshot with id 2144 has expired. You can: 1. increase the snapshot or changelog expiration time. 2. use consumer-id to ensure that unconsumed snapshots will not be expired.
at org.apache.paimon.utils.NextSnapshotFetcher.getNextSnapshot(NextSnapshotFetcher.java:68) ~[flink-catalog-connector-paimon-3.2.0-SNAPSHOT.jar:?]
at org.apache.paimon.table.source.DataTableStreamScan.nextPlan(DataTableStreamScan.java:184) ~[flink-catalog-connector-paimon-3.2.0-SNAPSHOT.jar:?]"
and i see the value of consumer in hdfs file is
"{
"nextSnapshot" : 2931
}"

### What doesn't meet your expectations?

the consumer-id read snapshot is 2931, which means consumer has read all the snapshots that are less than 2931, but i still have error "The snapshot with id 2144 has expired."

### Anything else?

_No response_

### Are you willing to submit a PR?

- [ ] I'm willing to submit a PR!

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with org.apache.paimon.utils.NextSnapshotFetcher.getNextSnapshot at NextSnapshotFetcher.java:68 and DataTableStreamScan.nextPlan at DataTableStreamScan.java:184. Reproduce the expired snapshot error on Paimon 1.0.1 with Flink 1.18 and inspect the HDFS consumer file containing nextSnapshot 2931. Done means explaining why snapshot 2144 can expire despite that consumer value and correcting the behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
data-engineering, stream-processing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.