@@ -42,7 +42,7 @@ SUCCESS_S1=0
4242for i in {1..15}
4343do
4444# Dynamically query the Standby broker for the current log end offset instead of raw directory size
45- STANDBY_OFFSET=$( docker-compose exec -T standby /opt/kafka/bin/kafka-run-class.sh kafka.tools.GetOffsetShell --bootstrap-server localhost:9094 --topic primary.commit-log --time -1 | awk -F ' :' ' {print $3}' | tr -d ' \r\n ' )
45+ STANDBY_OFFSET=$( docker-compose exec -T standby /opt/kafka/bin/kafka-run-class.sh org.apache. kafka.tools.GetOffsetShell --bootstrap-server localhost:9094 --topic primary.commit-log --time -1 | awk -F ' :' ' {print $3}' | tr -d ' \r\n ' )
4646 : " ${STANDBY_OFFSET:= 0} "
4747
4848 echo " Attempt $i /15 -> Standby Replicated Offset: $STANDBY_OFFSET messages"
@@ -76,7 +76,7 @@ docker-compose exec -T primary bash -c "for x in {1..200}; do echo '{\"event_id\
7676
7777echo " Querying primary cluster log end offset dynamically..."
7878# Dynamically fetch the current highest active offset from the broker
79- HIGH_WATERMARK=$( docker-compose exec -T primary /opt/kafka/bin/kafka-run-class.sh kafka.tools.GetOffsetShell --bootstrap-server localhost:9092 --topic commit-log --time -1 | awk -F ' :' ' {print $3}' | tr -d ' \r\n ' )
79+ HIGH_WATERMARK=$( docker-compose exec -T primary /opt/kafka/bin/kafka-run-class.sh org.apache. kafka.tools.GetOffsetShell --bootstrap-server localhost:9092 --topic commit-log --time -1 | awk -F ' :' ' {print $3}' | tr -d ' \r\n ' )
8080
8181# Fallback mechanism if GetOffsetShell output parsing is empty
8282if [ -z " $HIGH_WATERMARK " ]; then
@@ -149,7 +149,7 @@ docker-compose exec -T primary bash -c "for x in {1..100}; do echo '{\"event_id\
149149echo " Allowing MirrorMaker 2 automated recovery to stabilize..."
150150sleep 25
151151
152- POST_RESET_OFFSET=$( docker-compose exec -T standby /opt/kafka/bin/kafka-run-class.sh kafka.tools.GetOffsetShell --bootstrap-server localhost:9094 --topic primary.commit-log --time -1 | awk -F ' :' ' {print $3}' | tr -d ' \r\n ' )
152+ POST_RESET_OFFSET=$( docker-compose exec -T standby /opt/kafka/bin/kafka-run-class.sh org.apache. kafka.tools.GetOffsetShell --bootstrap-server localhost:9094 --topic primary.commit-log --time -1 | awk -F ' :' ' {print $3}' | tr -d ' \r\n ' )
153153: " ${POST_RESET_OFFSET:= 0} "
154154
155155echo " Standby Cluster Log Offset post-reset verification: $POST_RESET_OFFSET messages"
0 commit comments