Skip to content

Conversation

houssain-barouni
Copy link
Collaborator

@houssain-barouni houssain-barouni commented Jun 18, 2025

Description

Other problems were reported during Opensearch backup testing.
With opensearch, snapshot.endTimeInMillis can contain integer (0) or be null, and this is not well handled by Operate

curl 'http://localhost:9600/operate/actuator/backups' | jq
{
  "status": 400,
  "message": "Exception occurred when searching for backups: class java.lang.Integer cannot be cast to class java.lang.Long (java.lang.Integer and java.lang.Long are in module java.base of loader 'bootstrap')",
  "instance": "263b6af4-eaf4-411a-9be5-5be627e9763e",
  "type": "Invalid request"
}
[2025-06-17 21:19:33.384] [http-nio-0.0.0.0-9600-exec-2] ERROR
	io.camunda.operate.webapp.management.BackupController - ClientException: Exception occurred when searching for backups: Cannot invoke "java.lang.Long.longValue()" because the return value of "io.camunda.operate.store.opensearch.response.OpenSearchSnapshotInfo.getEndTimeInMillis()" is null

Checklist

Related issues

closes #

@github-actions github-actions bot added the component/operate Related to the Operate component/team label Jun 18, 2025
@houssain-barouni houssain-barouni marked this pull request as ready for review June 18, 2025 11:06
@houssain-barouni houssain-barouni requested review from kristinkomschow and a team June 18, 2025 11:06
@houssain-barouni houssain-barouni added backport stable/operate-8.5 backport stable/8.6 Backport a pull request to stable/8.6 backport stable/8.7 Backport a pull request to stable/8.7 labels Jun 18, 2025
Copy link
Contributor

@kristinkomschow kristinkomschow left a comment

Choose a reason for hiding this comment

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

I left some small comments but I'm pre-approving because the rest LGTM.

@@ -43,5 +43,18 @@ public void shouldPreferExtractingFromMetadataField() {
metadata.getVersion()),
"");
assertThat(extracted).isEqualTo(metadata);
assertThat(extracted.getBackupId())
.isEqualTo(
metadata.getBackupId()); // why backupId is not part of the Metadata.equals() method??
Copy link
Contributor

Choose a reason for hiding this comment

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

Good question. I don't see a good reason why it wouldn't be part of the Metadata.equals(), so I suggest adding it there instead of the separate assertion.

Copy link
Collaborator Author

@houssain-barouni houssain-barouni Jun 18, 2025

Choose a reason for hiding this comment

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

I don't want to add any risk :) But I will consider it later

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

}

@Test
public void shouldExtractingBackupIdAsIntegerFromMetadataField() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Naming nitpick: this should be shouldExtractBackupIdAsIntegerFromMetadataField

@houssain-barouni houssain-barouni added this pull request to the merge queue Jun 18, 2025
Merged via the queue into stable/8.6 with commit 0de2681 Jun 18, 2025
72 of 73 checks passed
@houssain-barouni houssain-barouni deleted the hb-bug-backup branch June 18, 2025 11:49
@backport-action
Copy link
Collaborator

Created backport PR for stable/operate-8.5:

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin backport-33920-to-stable/operate-8.5
git worktree add --checkout .worktree/backport-33920-to-stable/operate-8.5 backport-33920-to-stable/operate-8.5
cd .worktree/backport-33920-to-stable/operate-8.5
git reset --hard HEAD^
git cherry-pick -x 1ce4d123e9290b1913c2ce312081390443a54d3e
git push --force-with-lease

@backport-action
Copy link
Collaborator

Backport failed for stable/8.6, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin stable/8.6
git worktree add -d .worktree/backport-33920-to-stable/8.6 origin/stable/8.6
cd .worktree/backport-33920-to-stable/8.6
git switch --create backport-33920-to-stable/8.6
git cherry-pick -x 1ce4d123e9290b1913c2ce312081390443a54d3e

@backport-action
Copy link
Collaborator

Successfully created backport PR for stable/8.7:

@backport-action
Copy link
Collaborator

Successfully created backport PR for release-8.6.19:

@backport-action
Copy link
Collaborator

Successfully created backport PR for release-8.7.6:

houssain-barouni added a commit that referenced this pull request Jun 18, 2025
…pshot endTime (#33932)

# Description
Backport of #33920 to `release-8.6.19`.

relates to
houssain-barouni added a commit that referenced this pull request Jun 18, 2025
…shot endTime (#33933)

# Description
Backport of #33920 to `release-8.7.6`.

relates to
github-merge-queue bot pushed a commit that referenced this pull request Jun 18, 2025
…t endTime (#33931)

# Description
Backport of #33920 to `stable/8.7`.

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

Successfully merging this pull request may close these issues.

3 participants