Skip to content

Conversation

@tvaron3
Copy link
Member

@tvaron3 tvaron3 commented Sep 23, 2025

Description

Timestamp format was inconsistent in lease throughout life cycle of change feed processor. Initial timestamp when a lease is created has an appended [utc] because a different data object is used at lease creation than during updates. Once change feed processor starts processing the lease, the lease will get updated and the format of the timestamp is changed.

Current Flow

  • At time 0, lease created with [utc] appended to timestamp --> at time 1 and after, lease updated with [utc] not appended to timestamp

New flow

  • At time 0, lease created with [utc] not appended to timestamp --> at time 1 and after, lease updated with [utc] not appended to timestamp

@tvaron3
Copy link
Member Author

tvaron3 commented Sep 23, 2025

/azp run java - cosmos - tests

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@tvaron3 tvaron3 marked this pull request as ready for review September 23, 2025 17:49
@tvaron3 tvaron3 requested review from a team and kirankumarkolli as code owners September 23, 2025 17:49
Copilot AI review requested due to automatic review settings September 23, 2025 17:49
Copy link
Contributor

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 standardizes timestamp format in Change Feed Processor (CFP) lease objects by converting from ZonedDateTime.toString() to Instant.toString() format. The change removes inconsistent "[UTC]" suffixes that were appearing in some timestamps.

  • Updated timestamp generation in ServiceItemLease and ServiceItemLeaseV1 classes to use Instant format
  • Added comprehensive test to verify timestamp consistency across CFP lifecycle
  • Updated changelog to document the formatting change

Reviewed Changes

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

File Description
ServiceItemLease.java Changed timestamp generation from ZonedDateTime.toString() to toInstant().toString()
ServiceItemLeaseV1.java Applied same timestamp format change for consistency
CHANGELOG.md Added entry documenting the timestamp format change
IncrementalChangeFeedProcessorTest.java Added test to verify timestamps don't contain "[UTC]" suffix

…to tvaron3/changefeedprocessorTS

# Conflicts:
#	sdk/cosmos/azure-cosmos/CHANGELOG.md
Copy link
Member

@FabianMeiswinkel FabianMeiswinkel left a comment

Choose a reason for hiding this comment

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

This is a breakign change - would need either to be gated on a new Lease version - I am not convinced that it is worth it

…to tvaron3/changefeedprocessorTS

# Conflicts:
#	sdk/cosmos/azure-cosmos/CHANGELOG.md
@FabianMeiswinkel
Copy link
Member

This is a breakign change - would need either to be gated on a new Lease version - I am not convinced that it is worth it

Discussed offline - since the lease document in a flow of
T0: Initial creation
T1..TN: Lease document being updated when progress is recorded

Would have used the same format as now in T0 in T1 and later already this is not a breakign change but just a bug fix.

Copy link
Member

@FabianMeiswinkel FabianMeiswinkel left a comment

Choose a reason for hiding this comment

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

LGTM

@tvaron3 tvaron3 merged commit 979bebe into Azure:main Oct 15, 2025
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants