Copilot commented on code in PR #66409:
URL: https://github.com/apache/doris/pull/66409#discussion_r3802742153
##########
fs_brokers/cdc_client/src/main/java/org/apache/doris/cdcclient/controller/ClientController.java:
##########
@@ -103,12 +105,13 @@ public Object writeRecord(@RequestBody WriteRecordRequest
recordReq) {
/** Fetch lastest end meta */
@RequestMapping(path = "/api/fetchEndOffset", method = RequestMethod.POST)
- public Object fetchEndOffset(@RequestBody JobBaseConfig jobConfig) {
+ public Object fetchEndOffset(@RequestBody FetchEndOffsetRequest jobConfig)
{
LOG.info("Fetching end offset for job {}", jobConfig.getJobId());
try {
SourceReader reader = Env.getCurrentEnv().getMetaReader(jobConfig);
Env.getCurrentEnv().keepAlive(jobConfig.getJobId());
- return RestResponse.success(reader.getEndOffset(jobConfig));
+ FetchEndOffsetResult result = reader.fetchEndOffset(jobConfig);
+ return RestResponse.success(result);
Review Comment:
This changes the `/api/fetchEndOffset` contract from returning `Map<String,
String>` (end offset only) to returning a structured `FetchEndOffsetResult`
(end offset + lag bytes). That is a breaking wire-format change for
mixed-version deployments (old FE parsing a map will fail if CDC-client returns
an object; new FE parsing an object will fail if CDC-client returns a map). If
rolling upgrades are supported, consider keeping backward compatibility by
versioning the endpoint (e.g., `/api/fetchEndOffsetV2`) or making FE parsing
tolerant (try `FetchEndOffsetResult`, and fallback to parsing a map and setting
`lagBytes=-1`).
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]