merlimat opened a new pull request, #25658:
URL: https://github.com/apache/pulsar/pull/25658

   ## Summary
   
   Add `createdAtMs` / `sealedAtMs` to `SegmentInfo` (and the 
`SegmentInfoProto` wire format) alongside the existing `createdAtEpoch` / 
`sealedAtEpoch` — those are DAG generation numbers, not clocks, and can't drive 
retention or timestamp-based seek.
   
   The new fields are populated at the canonical lifecycle points:
   
   - `ScalableTopicController#createInitialMetadata` records a single `nowMs` 
shared by all initial segments.
   - `SegmentLayout#splitSegment` and `mergeSegments` take an explicit `nowMs` 
and thread it into the parents' seal time and the children's create time. 
`ScalableTopicController` captures `final long nowMs` once and passes it to 
both the local preview and the CAS-retried metadata transformer, so retries 
don't drift the timestamp between writers.
   - `DagWatchSession` writes both fields into the wire format.
   
   This is the prerequisite for upcoming work on sealed-segment retention GC 
and V5 seek-by-timestamp; **no behavior change in this PR**.
   
   ## Test plan
   
   - [x] New unit coverage in `SegmentLayoutTest` 
(`testSplitRecordsWallClockTimestamps`, `testMergeRecordsWallClockTimestamps`) 
and proto-roundtrip assertions in `DagWatchSessionTest`.
   - [x] All existing scalable tests pass: `SegmentLayoutTest` (17), 
`SubscriptionCoordinatorTest` (16), `DagWatchSessionTest` (14), 
`ScalableTopicControllerTest` (24), `V5SmokeTest`, `V5SegmentSplitTest`.
   - [x] Checkstyle clean (`pulsar-common`, `pulsar-broker`, 
`pulsar-client-v5`).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to