ilikepi63 commented on code in PR #1624:
URL: https://github.com/apache/iggy/pull/1624#discussion_r1993604496


##########
server/src/state/system.rs:
##########
@@ -241,6 +241,26 @@ impl SystemState {
                         topic.partitions.remove(&(last_partition_id - i));
                     }
                 }
+                EntryCommand::DeleteSegments(command) => {
+                    let stream_id = find_stream_id(&streams, 
&command.stream_id);
+                    let stream = streams
+                        .get_mut(&stream_id)
+                        .unwrap_or_else(|| panic!("{}", format!("Stream: 
{stream_id} not found")));
+                    let topic_id = find_topic_id(&stream.topics, 
&command.topic_id);
+                    let topic = stream
+                        .topics
+                        .get_mut(&topic_id)
+                        .unwrap_or_else(|| panic!("{}", format!("Topic: 
{topic_id} not found")));
+                    if topic.partitions.is_empty() {
+                        continue;
+                    }
+
+                    let partition_id = command.partition_id;
+
+                    let _partition = 
topic.partitions.get(&command.partition_id).unwrap_or_else(|| panic!("{}", 
format!("Partition {partition_id} not found.")));
+
+                    // HOWTO: get the segments from PartitionState?

Review Comment:
   :white_check_mark: 



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