Skip to content

roachtest: add split-file import test#167688

Merged
trunk-io[bot] merged 1 commit intocockroachdb:masterfrom
michae2:interleaved-import
Apr 13, 2026
Merged

roachtest: add split-file import test#167688
trunk-io[bot] merged 1 commit intocockroachdb:masterfrom
michae2:interleaved-import

Conversation

@michae2
Copy link
Copy Markdown
Collaborator

@michae2 michae2 commented Apr 7, 2026

Add an import roachtest that splits a dataset's data files into two halves and imports them via two separate IMPORT jobs into the same table. This verifies that successive imports produce a correct, complete dataset.

Epic: None

Release note: None

@trunk-io
Copy link
Copy Markdown
Contributor

trunk-io Bot commented Apr 7, 2026

😎 Merged successfully - details.

@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

@michae2 michae2 marked this pull request as ready for review April 7, 2026 16:36
@michae2 michae2 requested review from a team and mw5h April 7, 2026 16:37
@michae2 michae2 added the backport-26.2.x Flags PRs that need to be backported to 26.2 label Apr 7, 2026
@michae2 michae2 force-pushed the interleaved-import branch from d5025fd to 4503e40 Compare April 7, 2026 16:54
Copy link
Copy Markdown
Contributor

@mw5h mw5h left a comment

Choose a reason for hiding this comment

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

@mw5h reviewed 1 file and all commit messages, and made 2 comments.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on michae2).


pkg/cmd/roachtest/tests/import.go line 896 at r1 (raw file):

	var first, second []string
	for i, url := range urls {
		if i%2 == 0 {

It might be better to put the URLs into a slice and shuffle with slices.Shuffle(), then pick some random number of them. That way you get a randomized ordering and a random number of files in each import.


pkg/cmd/roachtest/tests/import.go line 907 at r1 (raw file):

	importStmt := formatImportStmt(ds.getTableName(), first, false)
	if _, err := conn.ExecContext(ctx, importStmt); err != nil {
		return errors.Wrap(err, "first import")

Does conn.ExecContext include the statement in its error message? I defensively put it in the error message for runSyncImportJob(), but maybe I didn't need to.

@michae2 michae2 force-pushed the interleaved-import branch 2 times, most recently from 91611c2 to ef32f11 Compare April 9, 2026 18:19
Copy link
Copy Markdown
Collaborator Author

@michae2 michae2 left a comment

Choose a reason for hiding this comment

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

@michae2 made 2 comments.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on mw5h).


pkg/cmd/roachtest/tests/import.go line 896 at r1 (raw file):

Previously, mw5h (Matt White) wrote…

It might be better to put the URLs into a slice and shuffle with slices.Shuffle(), then pick some random number of them. That way you get a randomized ordering and a random number of files in each import.

Good call, done.


pkg/cmd/roachtest/tests/import.go line 907 at r1 (raw file):

Previously, mw5h (Matt White) wrote…

Does conn.ExecContext include the statement in its error message? I defensively put it in the error message for runSyncImportJob(), but maybe I didn't need to.

Looks like it does not. Also added the statement to the error message.

Copy link
Copy Markdown
Contributor

@mw5h mw5h left a comment

Choose a reason for hiding this comment

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

:lgtm: Thanks!

@mw5h reviewed 1 file and all commit messages, made 1 comment, and resolved 2 discussions.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on michae2).

@michae2 michae2 force-pushed the interleaved-import branch from ef32f11 to 437d32a Compare April 10, 2026 18:10
@michae2
Copy link
Copy Markdown
Collaborator Author

michae2 commented Apr 13, 2026

/trunk merge

@blathers-crl
Copy link
Copy Markdown

blathers-crl Bot commented Apr 13, 2026

Detected infrastructure failure on trunk-merge branch (matched: self-hosted runner lost communication with the server). Automatically resubmitting to merge queue (attempt 1 of 2). (run link)

@blathers-crl
Copy link
Copy Markdown

blathers-crl Bot commented Apr 13, 2026

/trunk merge

@trunk-io
Copy link
Copy Markdown
Contributor

trunk-io Bot commented Apr 13, 2026

This PR is already in the queue

Add an import roachtest that splits a dataset's data files into two
halves and imports them via two separate IMPORT jobs into the same table.
This verifies that successive imports produce a correct, complete dataset.

Epic: None

Release note: None

Co-Authored-By: roachdev-claude <roachdev-claude-bot@cockroachlabs.com>
@michae2 michae2 force-pushed the interleaved-import branch from 437d32a to 9f848c0 Compare April 13, 2026 20:59
@michae2
Copy link
Copy Markdown
Collaborator Author

michae2 commented Apr 13, 2026

/trunk merge

@trunk-io trunk-io Bot merged commit a8d03b3 into cockroachdb:master Apr 13, 2026
25 checks passed
@michae2 michae2 deleted the interleaved-import branch April 14, 2026 00:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-26.2.x Flags PRs that need to be backported to 26.2 target-release-26.3.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants