adoroszlai commented on code in PR #12175:
URL: https://github.com/apache/ozone/pull/12175#discussion_r4709144755


##########
hadoop-ozone/dist/src/main/compose/xcompat/lib.sh:
##########
@@ -82,7 +69,50 @@ _test_checkpoint_compatibility() {
     compatibility/checkpoint.robot
 }
 
+# Generates version combinations for read tests in the form of
+#   reader=writer
+# printing to stdout.
+#
+# Ideally a combination should be tested if it is related to the current
+# version in any way:
+# - cluster running
+# - client who wrote the data
+# - client to read the data
+#
+# But due to `ozone` command overhead, old clients read other old writes
+# only if they support batch execution.
+get_read_version_combinations() {
+  [[ -n "${cluster_version}" ]] || return 1
+  [[ -n "${current_version}" ]] || return 2
+  [[ -n "${old_versions}" ]] || return 3
+
+  local all_versions="$old_versions $current_version"
+  local reader writer
+  for reader in ${all_versions}; do
+    local batch_reader=$(python3 -c "print(str('${reader}' >= 
'${BATCH_VERSION}').lower())")

Review Comment:
   Good point, but Python seems to be better:
   
   ```sh
   $ python3 -c "print('1.2.3' < '10.0')"
   True
   
   $ bash -c "[[ '1.2.3' < '10.0' ]] || echo wrong"
   wrong
   ```



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

Reply via email to