Add endpoint to return latest event record time - #6986
Conversation
| "getLatestEventRecordTime returns None when there are no events" in { | ||
| for { | ||
| ctx <- newEventStore() | ||
| latest <- ctx.eventStore.getLatestEventRecordTime(domainMigrationId)(traceContext) |
There was a problem hiding this comment.
perhaps a test with just an insertUpdate could be added.
There was a problem hiding this comment.
Good idea, added
eb02ac1 to
1ffabdc
Compare
1ffabdc to
1838fed
Compare
|
@ray-roestenburg-da I think the static checks failure should be fixed by #7024. I just rebased, would you mind running CI again? Thank you! |
|
@mrdziuban Please add the new API endpoint to |
Thanks for the reminder, added it. |
Fixes canton-network#3071 Adds a new `/v0/events/latest-record-time` endpoint that finds the latest record time for which `/v0/events` will return events. `ScanEventStore#getLatestEventRecordTime` reuses `resolveCurrentMigrationCap` to ensure it has the same behavior as `getEvents`. Signed-off-by: Matt Dziuban <mrdziuban@gmail.com>
…ring`. Sphinx doesn't like the plain `type: string`, plus this aligns with the convention used for all other endpoints. Signed-off-by: Matt Dziuban <mrdziuban@gmail.com>
Signed-off-by: Matt Dziuban <mrdziuban@gmail.com>
Signed-off-by: Matt Dziuban <mrdziuban@gmail.com>
a8872dd to
6cc339a
Compare
| )(implicit tc: TraceContext): Future[Option[CantonTimestamp]] = | ||
| resolveCurrentMigrationCap( | ||
| verdictStore.lastIngestedRecordTime, | ||
| updateHistory.lastIngestedRecordTime, |
There was a problem hiding this comment.
Note: Looking at if this is bounded, as long as the ingested record time is advanced at least once, getLastEventRecordTime is bounded. There might be some time where the max has to be retrieved from the DB (before the record time is advanced by ingestion), but I think that is fine.
|
Is it possible the test failure is intermittent? |
|
Re-running, you ran into a known intermittent issue (which we've just triaged yesterday). |
Fixes #3071
Adds a new
/v0/events/latest-record-timeendpoint that finds the latest record time for which/v0/eventswill return events.ScanEventStore#getLatestEventRecordTimereusesresolveCurrentMigrationCapto ensure it has the same behavior asgetEvents.I confirmed that the
/v0/events/latest-record-timepath won't conflict with the parameterized/v0/events/{update_id}path -- the Pekko generator for guardrail sorts routes so all static paths appear before any parameterized paths.Pull Request Checklist
Cluster Testing
/cluster_teston this PR to request it, and ping someone with access to the DA-internal system to approve it./upgrade_teston this PR to request it, and ping someone with access to the DA-internal system to approve it./hdm_teston this PR to request it, and ping someone with access to the DA-internal system to approve it./lsu_teston this PR to request it, and ping someone with access to the DA-internal system to approve it.PR Guidelines
Fixes #n, and mention issues worked on using#nMerge Guidelines