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

Revised IT to detect backward incompatible change #16779

Merged
merged 48 commits into from
Aug 7, 2024

Conversation

findingrish
Copy link
Contributor

@findingrish findingrish commented Jul 23, 2024

Added a new revised IT group BackwardCompatibilityMain. The idea is to catch potential backward compatibility issues that may arise during rolling upgrade.

This test group runs a docker-compose cluster with Overlord & Coordinator service on the previous druid version.

Following env vars are required in the GHA file .github/workflows/unit-and-integration-tests-unified.yml to run this test

DRUID_PREVIOUS_VERSION -> Previous druid version to test backward incompatibility.
DRUID_PREVIOUS_VERSION_DOWNLOAD_URL -> URL to fetch the tar. 

Note, that this test group will remain disabled on Apache until we find a way to host druid tar in a separate location.

Limitations

  • druid-testing-tools jar is not published. The image for the previous version still uses the
    extension from the current build. This could break in case of incompatible changes in this extension.
    In such a scenario the test should be disabled. However, this extension is primarily used to
    test specific error scenarios and launch custom node role service (used in HighAvailability test group).

This PR has:

  • been self-reviewed.
  • added documentation for new or modified features or behaviors.
  • a release note entry in the PR description.
  • added Javadocs for most classes and all non-trivial methods. Linked related entities via Javadoc links.
  • added or updated version, license, or notice information in licenses.yaml
  • added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.
  • added unit tests or modified existing tests to cover new code paths, ensuring the threshold for code coverage is met.
  • added integration tests.
  • been tested in a test Druid cluster.

DRUID_PREVIOUS_VERSION_DOWNLOAD_URL:
required: false
type: string
DRUID_PREVIOUS_IT_IMAGE_NAME:
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can remove this image name. We can easily derive it from the DRUID_PREVIOUS_VERSION

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done, added a job to derive it internally.

@@ -57,6 +57,19 @@ on:
AWS_SECRET_ACCESS_KEY:
required: false
type: string
BACKWARD_INCOMPATIBILITY_IT_ENABLED:
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can remove this as well. If druid previous version is null, we can just skip running the backward compatibility it.


package org.apache.druid.testsEx.categories;

public class BackwardIncompatibility
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
public class BackwardIncompatibility
public class BackwardCompatibility

Nit


ENV DRUID_HOME=/usr/local/druid

# Populate build artifacts

COPY apache-druid-${DRUID_VERSION}-bin.tar.gz /usr/local/
COPY druid-it-tools-${DRUID_VERSION}.jar /tmp/druid/extensions/druid-it-tools/
COPY druid-it-tools-${DRUID_TESTING_TOOLS_VERSION}.jar /tmp/druid/extensions/druid-it-tools/
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we make loading this testing tool version optional ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This doesn't seem trivial.
The old image wouldn't run since the extension is added in the common extension list here https://github.com/apache/druid/blob/master/integration-tests-ex/cases/cluster/Common/environment-configs/common.env#L53.
The IT framework allows extending the config file to add more extensions but there is no way to remove an extension.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Adding a note on this limitation in description and test readme file.

if (sqlTaskStatus.getState().isFailure()) {
Assert.fail(StringUtils.format(
"Unable to start the task successfully.\nPossible exception: %s",
sqlTaskStatus.getError()

Check notice

Code scanning / CodeQL

Use of default toString() Note test

Default toString(): ErrorResponse inherits toString() from Object, and so is not suitable for printing.
if (sqlTaskStatus.getState().isFailure()) {
Assert.fail(StringUtils.format(
"Unable to start the task successfully.\nPossible exception: %s",
sqlTaskStatus.getError()

Check notice

Code scanning / CodeQL

Use of default toString() Note test

Default toString(): ErrorResponse inherits toString() from Object, and so is not suitable for printing.
if (exportTask.getState().isFailure()) {
Assert.fail(StringUtils.format(
"Unable to start the task successfully.\nPossible exception: %s",
exportTask.getError()

Check notice

Code scanning / CodeQL

Use of default toString() Note test

Default toString(): ErrorResponse inherits toString() from Object, and so is not suitable for printing.
if (sqlTaskStatus.getState().isFailure()) {
Assert.fail(StringUtils.format(
"Unable to start the task successfully.\nPossible exception: %s",
sqlTaskStatus.getError()

Check notice

Code scanning / CodeQL

Deprecated method or constructor invocation Note test

Invoking
SeekableStreamSupervisorSpec.getDataSchema
should be avoided because it has been deprecated.
if (sqlTaskStatus.getState().isFailure()) {
Assert.fail(StringUtils.format(
"Unable to start the task successfully.\nPossible exception: %s",
sqlTaskStatus.getError()

Check notice

Code scanning / CodeQL

Use of default toString()

Default toString(): ErrorResponse inherits toString() from Object, and so is not suitable for printing.
if (exportTask.getState().isFailure()) {
Assert.fail(StringUtils.format(
"Unable to start the task successfully.\nPossible exception: %s",
exportTask.getError()

Check notice

Code scanning / CodeQL

Use of default toString()

Default toString(): ErrorResponse inherits toString() from Object, and so is not suitable for printing.
@findingrish
Copy link
Contributor Author

All the revised ITs have run successfully (cc31175).

Disabling this IT in Apache for now.

@cryptoe cryptoe merged commit 99313e9 into apache:master Aug 7, 2024
91 checks passed
Copy link
Contributor

@kfaraz kfaraz left a comment

Choose a reason for hiding this comment

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

@findingrish , left some minor suggestions.


package org.apache.druid.testsEx.categories;

public class BackwardCompatibilityMain
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add a small javadoc here, in particular pointing out what the "Main" stands for.

import java.util.Arrays;
import java.util.List;

public class MultiStageQuery
Copy link
Contributor

Choose a reason for hiding this comment

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

Please rename to MultiStageQueryTest.


@RunWith(DruidTestRunner.class)
@Category(BackwardCompatibilityMain.class)
public class ITBCMainIndexerTest extends IndexerTest
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we drop the BCMain in the name?
It is redundant since the class is already in the backward compat package.

@kfaraz kfaraz added this to the 31.0.0 milestone Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants