Skip to content

adding new types to dencoder#16

Merged
rzarzynski merged 1 commit intomasterfrom
wip-nitzan-new-types-added
Aug 28, 2023
Merged

adding new types to dencoder#16
rzarzynski merged 1 commit intomasterfrom
wip-nitzan-new-types-added

Conversation

@NitzanMordhai
Copy link
Contributor

Need to adjust all the new types forward_incompat folders

Need to adjust all the new types forward_incompat folders

Signed-off-by: Nitzan Mordechai <nmordech@redhat.com>
@rzarzynski
Copy link
Contributor

The starter's doc: https://docs.ceph.com/en/main/dev/corpus/.

The clue of this change is to ignore forward-incompatibility (starting at particular version) of some types that we were missing in ceph-dencoder for years but recently added (thankfully to @NitzanMordhai). The example here is MonCommand.

The structure of the list comes from src/test/encoding/readable.sh:

test_object() {
    # ...
    if $CEPH_DENCODER type $type 2>/dev/null; then
      #echo "type $type";
      echo "        $vdir/objects/$type"

      # is there a fwd incompat change between $arversion and $version?
      incompat=""
      incompat_paths=""
      sawarversion=0
      for iv in `ls $dir/archive | sort -n`; do
        if [ "$iv" = "$arversion" ]; then
          sawarversion=1
        fi

        if [ $sawarversion -eq 1 ] && [ -e "$dir/archive/$iv/forward_incompat/$type" ]; then
          incompat="$iv"

          # Check if we'll be ignoring only specified objects, not whole type. If so, remember
          # all paths for this type into variable. Assuming that this path won't contain any
          # whitechars (implication of above for loop).
          if [ -d "$dir/archive/$iv/forward_incompat/$type" ]; then
            if [ -n "`ls $dir/archive/$iv/forward_incompat/$type/ | sort -n`" ]; then
              incompat_paths="$incompat_paths $dir/archive/$iv/forward_incompat/$type"
            else
              echo "type $type directory empty, ignoring whole type instead of single objects"
            fi;
          fi
        fi

        if [ "$iv" = "$version" ]; then
          rm -rf $tmp1 $tmp2
          break
        fi
      done

      if [ -n "$incompat" ]; then
        if [ -z "$incompat_paths" ]; then
          echo "skipping incompat $type version $arversion, changed at $incompat < code $myversion"
          rm -rf $tmp1 $tmp2
          return
        else
          # If we are ignoring not whole type, but objects that are in $incompat_path,
          # we don't skip here, just give info.
          echo "postponed skip one of incompact $type version $arversion, changed at $incompat < code $myversion"
        fi;
      fi

Copy link
Contributor

@rzarzynski rzarzynski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with one minor thing: the commit title. Before merging it would be rework to reflect we're ignoring forward incompatibility of some old types we're registering now to ceph-dencoder.

@rzarzynski rzarzynski requested a review from neha-ojha August 23, 2023 16:25
@rzarzynski rzarzynski merged commit 585eae9 into master Aug 28, 2023
@jdurgin jdurgin deleted the wip-nitzan-new-types-added branch November 15, 2023 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants