Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Checksum changes for existing migration scripts since release 0.5.2 #298

Closed
lennehendrickx opened this issue May 14, 2024 · 3 comments · Fixed by #299
Closed

Checksum changes for existing migration scripts since release 0.5.2 #298

lennehendrickx opened this issue May 14, 2024 · 3 comments · Fixed by #299
Assignees

Comments

@lennehendrickx
Copy link

lennehendrickx commented May 14, 2024

We have issue with checksums which have changed since 0.5.2 for existing migration scripts.

Example script

PUT /channel_1_es7
Content-Type: application/json

{
  "aliases": {
    "channel": {}
  },
  "settings": {
    "index": {
      "number_of_shards": 1
    },
    "refresh_interval": "30s",
    "default_pipeline": "ingestion-pipeline"
  },
  "mappings": {
    "dynamic": "strict",
    "properties": {
      "channelDisplayName": {
        "type": "text",
        "fields": {
          "keyword": {
            "type": "keyword",
            "ignore_above": 256
          }
        }
      },
      "channelId": {
        "type": "keyword"
      },
      "channelName": {
        "type": "text",
        "fields": {
          "keyword": {
            "type": "keyword",
            "ignore_above": 256
          }
        }
      },
      "createdAt": {
        "type": "date",
        "format": "date_optional_time"
      },
      "ingestedAt": {
        "type": "date",
        "format": "date_optional_time"
      },
      "mediumChannelId": {
        "type": "keyword"
      },
      "mediumId": {
        "type": "keyword"
      },
      "organizationId": {
        "type": "long"
      },
      "testChannel": {
        "type": "boolean"
      },
      "updatedAt": {
        "type": "date",
        "format": "date_optional_time"
      }
    }
  }
}

Checksum

  • before 0.5.2: 1754437828
  • since 0.5.2: -1447002170

Note that the migration script has a trailing newline.
Could this issue be triggered by the changes made in this commit? 3d80bc4ae448f588267e4b9edb9ab954409441e8?

@xtermi2 xtermi2 self-assigned this May 14, 2024
@xtermi2
Copy link
Collaborator

xtermi2 commented May 14, 2024

Hi @lennehendrickx
yes, this is related to this commit, respectively #293 / #294
This was a bug, before all trailing newlines were removed.

Let me try if I can calculate the checksume with removed trailing newlines.
When this works, I would provide a property to configure this "legacy" checksum calculation

@xtermi2 xtermi2 changed the title Checksum changes for existing migration scripts since release 5.2.0 Checksum changes for existing migration scripts since release 0.5.2 May 19, 2024
xtermi2 added a commit that referenced this issue May 19, 2024
…scripts for backward compatibility / hash stability
@xtermi2
Copy link
Collaborator

xtermi2 commented May 19, 2024

@lennehendrickx can you please try out the pull request #299
you can build elasticsearch-evolution via ./mvnw clean install -DskipTests=true and set version to 0.6.0-SNAPSHOT in your application.You have to set the configuration property trimTrailingNewlineInMigrations to true.

@lennehendrickx
Copy link
Author

Hi @xtermi2 ,

Thanks for your quick fix.
I was able to verify that the new config flag trimTrailingNewlineInMigrations works as expected.
With the snapshot version and the flag enabled, I now get the old checksum.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants