Skip to content

[Bug] Skip incremental sync when delta source has no new commits - #930

Open
zhang-arvin wants to merge 1 commit into
apache:mainfrom
zhang-arvin:fix/928-delta-kernel-empty-range
Open

[Bug] Skip incremental sync when delta source has no new commits#930
zhang-arvin wants to merge 1 commit into
apache:mainfrom
zhang-arvin:fix/928-delta-kernel-empty-range

Conversation

@zhang-arvin

Copy link
Copy Markdown

Fixes #928

What changes were proposed in this pull request?

DeltaKernelConversionSource.getCommitsBacklog computed the incremental range as start = versionAtLastSyncInstant + 1, end = latestVersion with no start <= end guard. With no new commits since the last sync, the range became [n+1, n] and Delta Kernel's getChanges rejected the inverted interval with Invalid version range, breaking the documented pattern of calling sync after every write / on a schedule.

The fix detects versionAtLastSyncInstant >= latestVersion, logs that there is nothing to sync, and returns an empty commits backlog, making the no-op sync successful — matching the behavior of Hudi and Parquet sources.

How was this patch tested?

  • ./mvnw -pl xtable-core -am -DskipTests compile
  • Existing ITDeltaKernelConversionSource / TestDeltaKernelSync suites cover incremental sync (local run pending CI).

Fixes apache#928: getCommitsBacklog computed start = lastSyncVersion + 1 with no
start <= end guard, so a re-sync with no new commits passed an inverted
version range [n+1, n] to Delta Kernel's getChanges, which failed with
"Invalid version range". With no new commits the sync is now a successful
no-op, matching the Hudi and Parquet sources.
@the-other-tim-brown

Copy link
Copy Markdown
Contributor

Let's add a basic test to xtable-core/src/test/java/org/apache/xtable/delta/ITDeltaConversionSource.java to exercise this path

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Delta (Kernel) source: re-sync with no new commits fails with "Invalid version range [n+1, n]"

2 participants