Skip to content

Conversation

@sushantmane
Copy link
Contributor

Switch back to PubSubPosition based reads with offset as fallback

Code changes

  • Added new code behind a config. If so list the config names and their default values in the PR description.
  • Introduced new log lines.
    • Confirmed if logs need to be rate limited to avoid excessive logging.

Concurrency-Specific Checks

Both reviewer and PR author to verify

  • Code has no race conditions or thread safety issues.
  • Proper synchronization mechanisms (e.g., synchronized, RWLock) are used where needed.
  • No blocking calls inside critical sections that could lead to deadlocks or performance degradation.
  • Verified thread-safe collections are used (e.g., ConcurrentHashMap, CopyOnWriteArrayList).
  • Validated proper exception handling in multi-threaded code to avoid silent thread termination.

How was this PR tested?

  • New unit tests added.
  • New integration tests added.
  • Modified or extended existing tests.
  • Verified backward compatibility (if applicable).

Does this PR introduce any user-facing or breaking changes?

  • No. You can skip the rest of this section.
  • Yes. Clearly explain the behavior change and its impact.

Copilot AI review requested due to automatic review settings October 28, 2025 20:08
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR removes the getPubSubPositionString method and its associated test, replacing its usage with direct calls to pubSubPositionDeserializer.toPosition(). The key changes enable better position comparison by using actual PubSubPosition objects rather than numeric offsets, and utilize the deserializePositionWithOffsetFallback method for safer deserialization with fallback logic.

  • Removes PubSubUtil.getPubSubPositionString utility method and its test
  • Replaces numeric offset comparisons with proper position comparisons using diffPosition and object equality
  • Updates deserializePositionWithOffsetFallback to remove the offset > 0 guard condition
  • Integrates proper position deserialization with fallback in extractUpstreamPosition

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
PubSubUtil.java Removes getPubSubPositionString utility method
PubSubUtilTest.java Removes test coverage for getPubSubPositionString
OffsetRecord.java Removes unused import and updates deserializePositionWithOffsetFallback condition
KafkaTopicDumper.java Replaces getPubSubPositionString with direct toPosition calls
StoreIngestionTask.java Updates position deserialization condition and integrates fallback in extractUpstreamPosition
StoreIngestionTaskTest.java Changes test assertions to use full position equality instead of numeric offset comparison
PartitionTracker.java Replaces getPubSubPositionString with direct toPosition call
LeaderFollowerStoreIngestionTask.java Replaces numeric offset comparisons with proper position comparisons using diffPosition and symbolic position checks

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link

Hi there. This pull request has been inactive for 30 days. To keep our review queue healthy, we plan to close it in 7 days unless there is new activity. If you are still working on this, please push a commit, leave a comment, or convert it to draft to signal intent. Thank you for your time and contributions.

@github-actions github-actions bot added the stale label Nov 28, 2025
@sushantmane sushantmane force-pushed the sumane/switch-back-reads-to-PubSubPosition branch from 6fa7342 to e86b854 Compare December 3, 2025 19:38
Copilot AI review requested due to automatic review settings December 3, 2025 22:47
@sushantmane sushantmane force-pushed the sumane/switch-back-reads-to-PubSubPosition branch from e86b854 to cd66555 Compare December 3, 2025 22:47
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions github-actions bot removed the stale label Dec 4, 2025
@sushantmane sushantmane force-pushed the sumane/switch-back-reads-to-PubSubPosition branch 2 times, most recently from a5271ff to a80f0a5 Compare December 9, 2025 22:58
Copilot AI review requested due to automatic review settings December 9, 2025 22:58
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 15 out of 15 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +1124 to +1125
if ((PubSubSymbolicPosition.EARLIEST.equals(latestConsumedRtPosition)
&& !PubSubSymbolicPosition.EARLIEST.equals(upstreamStartPosition))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't quite understand what the first condition means

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It means we should always update latestConsumedRtPosition when it is currently EARLIEST and upstreamStartPosition has a new value that differs from EARLIEST.

sushantmane and others added 8 commits January 6, 2026 13:20
…bolic positions

The deserializePositionWithOffsetFallback method was incorrectly treating
symbolic positions (EARLIEST, LATEST) as regular positions and comparing
their numeric offsets against the provided minimum offset. This caused
EARLIEST (numeric offset -1) to be replaced with an offset-based position
when the minimum offset was >= 0.

Added a guard to detect and preserve symbolic positions before performing
numeric offset comparison, ensuring they are returned as-is regardless of
the minimum offset parameter.

This fix resolves the failing testDeserializePositionWithOffsetFallback
test in LeaderFollowerStoreIngestionTaskTest.

Test: ./gradlew :clients:da-vinci-client:test --tests "com.linkedin.davinci.kafka.consumer.LeaderFollowerStoreIngestionTaskTest"
@sushantmane sushantmane force-pushed the sumane/switch-back-reads-to-PubSubPosition branch from a80f0a5 to 2311a4e Compare January 6, 2026 22:28
Copilot AI review requested due to automatic review settings January 6, 2026 22:49
@sushantmane sushantmane force-pushed the sumane/switch-back-reads-to-PubSubPosition branch from 2311a4e to d9893c6 Compare January 6, 2026 22:49
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 17 out of 17 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

2 participants