hubcio commented on code in PR #3101:
URL: https://github.com/apache/iggy/pull/3101#discussion_r3072366859


##########
core/server/src/binary/handlers/messages/send_messages_handler.rs:
##########
@@ -197,8 +197,15 @@ pub async fn handle_send_messages(
         topic_id: topic.topic_id,
         partition_id,
     };
-    shard.append_messages(partition, batch).await?;
+    let base_offset = shard.append_messages(partition, batch).await?;
 
-    sender.send_empty_ok_response().await?;
+    const OFFSET_SIZE: usize = size_of::<u64>();
+    const PARTITION_SIZE: usize = size_of::<u32>();
+    const RESPONSE_SIZE: usize = OFFSET_SIZE + PARTITION_SIZE;
+
+    let mut response = [0u8; RESPONSE_SIZE];
+    response[..OFFSET_SIZE].copy_from_slice(&base_offset.to_le_bytes());
+    response[OFFSET_SIZE..].copy_from_slice(&(partition_id as 
u32).to_le_bytes());
+    sender.send_ok_response(&response).await?;

Review Comment:
   this is done incorrectly. check crate `binary_protocol` and 
`core/binary_protocol/src/requests/messages/send_messages.rs`. IMHO you need to 
add SendMessagesResponse struct.



-- 
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