Skip to content

Skip macOS resource fork files in upgrade migration parser#31012

Open
ellabaron-code wants to merge 3 commits intoyugabyte:masterfrom
Shopify:fix-macos-dotfile-migration-parser
Open

Skip macOS resource fork files in upgrade migration parser#31012
ellabaron-code wants to merge 3 commits intoyugabyte:masterfrom
Shopify:fix-macos-dotfile-migration-parser

Conversation

@ellabaron-code
Copy link
Copy Markdown
Collaborator

@ellabaron-code ellabaron-code commented Apr 8, 2026

Summary

Skip macOS AppleDouble resource-fork files (._*) during upgrade-test tarball extraction so they never reach ValidateYsqlMigrationCompatibility.

Problem

Upgrade integration test, xcluster_upgrade-itest, fails on macOS when loading an old-version release tarball.

The release tarballs are built on macOS, which embeds AppleDouble companion files (._V53__22144__foo.sql next to each V53__22144__foo.sql) to preserve HFS+ extended attributes. When gtar extracts the tarball on another macOS host, those companions are faithfully written to disk alongside the real migrations.

ValidateYsqlMigrationCompatibility walks share/ysql_migrations/, filters .sql by suffix (which ._V…sql passes), and then fails the filename-regex check with:

Invalid migration file name: ._V53__22144__foo.sql

Fix

Pass --exclude=._* to the tar xzf invocation in DownloadAndGetBinPath. The junk never lands on disk, so no downstream code needs to know it existed.

Works with both tar on Linux and gtar on macOS (both GNU tar); the flag is a no-op on tarballs that don't contain ._* entries.

Why this approach

Earlier iterations filtered the files inside the migration reader. That's more fragile — any future code that walks the extracted tree (not just the migration validator) would hit the same problem and have to re-discover the fix. Excluding at extraction time fixes it once, at the source.

Test plan

  • Run xcluster_upgrade-itest on macOS — this is the reliable verifier: without the fix it fails at ValidateYsqlMigrationCompatibility on ._* migration files, and with the fix it passes end-to-end.
  • Run xcluster_upgrade-itest on Linux to confirm the extra --exclude=._* flag doesn't regress anything.

Phorge: D52008

  macOS embeds ._ resource fork files inside release tarballs. When
  extracted, these mirror the original .sql filenames and pass the
  extension check but fail the migration name regex, causing test
  failures on macOS.
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a check to skip macOS resource fork files (starting with '._') during YSQL migration compatibility validation to prevent processing errors. The reviewer suggests making this check unconditional by removing the platform-specific guard, as these metadata files can appear on other operating systems if a tarball created on macOS is extracted there.

Comment thread src/yb/integration-tests/upgrade-tests/upgrade_test_base.cc Outdated
@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 8, 2026

Deploy Preview for infallible-bardeen-164bc9 ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 8edd3f5
🔍 Latest deploy log https://app.netlify.com/projects/infallible-bardeen-164bc9/deploys/69d5c2728f748100085d8ced
😎 Deploy Preview https://deploy-preview-31012--infallible-bardeen-164bc9.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@rahulb-yb
Copy link
Copy Markdown
Contributor

trigger Jenkins

@hari90
Copy link
Copy Markdown
Contributor

hari90 commented Apr 13, 2026

Phorge diff synced: D52008
Commit: 9371c243

Jenkins build has been triggered. Results will be posted here once it completes.


JenkinsBot

@hari90
Copy link
Copy Markdown
Contributor

hari90 commented Apr 14, 2026

Jenkins build for commit 9371c243: Pass

Passed: 12


🔨 DB Build/Test Job Summary

Build Total Passed Failed Failed After Retries
D52008-arm-alma8-clang21-release 5796 5720 13 8
D52008-arm-mac14-clang-release 13 13 0 0
D52008-alma8-gcc12-fastdebug 5807 5676 5 3
D52008-mac14-clang-release 2 2 0 0
D52008-ubuntu22.04-clang21-debug 2 2 0 0
D52008-alma8-clang21-tsan 5807 4494 19 15
D52008-alma8-clang21-release 5796 5724 4 1
D52008-alma9-clang21-asan 5807 5405 11 9

Full status


JenkinsBot

Comment thread src/yb/integration-tests/upgrade-tests/upgrade_test_base.cc Outdated
@hari90
Copy link
Copy Markdown
Contributor

hari90 commented Apr 23, 2026

trigger jenkins

@hari90
Copy link
Copy Markdown
Contributor

hari90 commented Apr 23, 2026

Phorge diff synced: D52008
Commit: b547b9c5

Jenkins build has been triggered. Results will be posted here once it completes.


JenkinsBot

@hari90
Copy link
Copy Markdown
Contributor

hari90 commented Apr 23, 2026

@ellabaron-code please update the PR description with what the fix is.

@ellabaron-code ellabaron-code requested a review from hari90 April 23, 2026 17:31
@ellabaron-code
Copy link
Copy Markdown
Collaborator Author

Hi Hari,
I've updated PR description just as you have requested. Please, have a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants