Skip to content

Migrate several indexing and compaction integration tests to embedded-tests #18207

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

Open
wants to merge 38 commits into
base: master
Choose a base branch
from

Conversation

kfaraz
Copy link
Contributor

@kfaraz kfaraz commented Jul 4, 2025

Summary

  • This patch migrates several indexing and compaction integration tests (several of which have been flaking out a lot recently) to the embedded-tests framework.
  • Overall, this migration will save about 1 hr 30 mins of GitHub runner time.
  • The MiddleManager version of the integration tests has currently not been ported as they are slower and currently not desirable in embedded tests (because they launch child processes).
  • The MM-based embedded-tests can be easily enabled at any point in the future.

Changes

  • The new tests use SQL queries to verify results instead of native since the SQL syntax is much more concise and makes for more readable unit tests. We can add native queries later or in future tests that are migrated to this framework.
  • Add TaskBuilder utility to create Task objects using fluent syntax
  • Add JSON data resource files to embedded-tests

Test migrations

Old test New test
ITPerfectRollupParallelIndexTest EmbeddedIndexParallelTaskTest
ITBestEffortRollupParallelIndexTest EmbeddedIndexParallelTaskTest, added as a new test parameter which uses dynamic partitioning
ITAutoCompactionTest EmbeddedAutoCompactionTest
ITAutoCompactionLockContentionTest EmbeddedAutoCompactionUpgradeTest
ITAutoCompactionLockContentionTest EmbeddedKafkaClusterMetricsTest, method test_ingestClusterMetrics_compactionSkipsLockedIntervals()
ITCompactionTaskTest EmbeddedCompactionTaskTest
ITCompactionSparseColumnTest EmbeddedCompactionSparseColumnTest
ITOverlordResourceTest Already being verified in EmbeddedOverlordClientTest
ITOverlordResourceNotFoundTest Already being verified in EmbeddedOverlordClientTest

New nested tests

  • EmbeddedCentralizedSchemaPublishFailureTest for the group cds-task-schema-publish-disabled
  • EmbeddedCentralizedSchemaMetadataQueryDisabledTest for the group cds-coordinator-metadata-query-disabled

Test run times

Test Actual test time Total time including setup
EmbeddedIndexParallelTaskTest(indexer) 38 s 38 s
EmbeddedAutoCompactionTest (indexer) 1 min 20 s 1 min 20 s
EmbeddedCompactionSparseColumnTest (indexer) 12 s 12 s
Standard ITPerfectRollupParallelIndexTest 10 min 15 min
Standard ITPerfectRollupParallelIndexTest
(Indexer, shuffle deep store test, only 1 config changed)
10 min 15 min
Standard ITPerfectRollupParallelIndexTest
(MM, shuffle deep store test, only 1 config changed)
10 min 15 min
Standard ITBestEffortRollupParallelIndexTest 2 min NA(setup includes other tests too)
Revised ITBestEffortRollupParallelIndexTest 4 min 10 s "
Standard ITAutoCompactionTest (middle manager) 25 mins "
Standard ITAutoCompactionTest (indexer) 15 mins "
Standard ITCompactionSparseColumnTest (indexer) 2 min 10 s "

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.

@kfaraz kfaraz changed the title Add EmbeddedIndexParallelTaskTest to migrate ITPerfectRollupParallelI… Migrate ITPerfectRollupParallelIndexTest and ITBestEffortRollupParallelIndexTest to embedded-tests Jul 4, 2025
@github-actions github-actions bot added the GHA label Jul 4, 2025
@kfaraz kfaraz requested a review from gianm July 4, 2025 15:53
@kfaraz kfaraz changed the title Migrate ITPerfectRollupParallelIndexTest and ITBestEffortRollupParallelIndexTest to embedded-tests Migrate several indexing and compaction integration tests to embedded-tests Jul 8, 2025
kfaraz added a commit that referenced this pull request Jul 8, 2025
Bug:
Concurrent append uses lock of type APPEND which always uses a lock version of epoch 1970-01-01.

This can cause data loss in a flow as follows:
- Ingest data using an APPEND task to an empty interval
- Mark all the segments as unused
- Re-run the APPEND task
- Data is not visible since old segment IDs (now unused) are allocated again

Fix:
In segment allocation, do not reuse an old segment ID, used or unused.
This fix was already done for some cases back in #16380 .
An embedded test for this has been included in #18207
@@ -0,0 +1,3 @@
{"timestamp": "2013-08-31T01:02:33Z", "page": "Gypsy Danger", "language" : "en", "tags": ["t1", "t2"], "user" : "nuclear", "unpatrolled" : "true", "newPage" : "true", "robot": "false", "anonymous": "false", "namespace":"article", "continent":"North America", "country":"United States", "region":"Bay Area", "city":"San Francisco", "added": 57, "deleted": 200, "delta": -143}
Copy link
Member

Choose a reason for hiding this comment

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

drive by comment/nit: i know this isn't new, but imo we should fix the problem of referring to this dataset as 'wikipedia' because it is confusing with the quickstart wikipedia data which is also going to be used in some tests, and this stuff only has a vaguely similar schema, maybe tiny-wikipedia or something to indicate that its a very small dataset would help clear things up?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the suggestion! I will rename these datasets accordingly.

@kfaraz kfaraz closed this Jul 12, 2025
@kfaraz kfaraz reopened this Jul 12, 2025
@kfaraz kfaraz closed this Jul 12, 2025
@kfaraz kfaraz reopened this Jul 12, 2025
@kfaraz kfaraz requested a review from clintropolis July 12, 2025 13:16
@kfaraz kfaraz closed this Jul 13, 2025
@kfaraz kfaraz reopened this Jul 13, 2025
@kfaraz kfaraz closed this Jul 13, 2025
@kfaraz kfaraz reopened this Jul 13, 2025
Comment on lines +354 to +358
InlineSchemaDataSourceCompactionConfig
.builder()
.forDataSource(dataSource)
.withSkipOffsetFromLatest(Period.seconds(0))
.withMaxRowsPerSegment(compactedMaxRowsPerSegment)

Check notice

Code scanning / CodeQL

Deprecated method or constructor invocation Note test

Invoking
Builder.withMaxRowsPerSegment
should be avoided because it has been deprecated.
@Akshat-Jain Akshat-Jain reopened this Jul 14, 2025
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