Skip to content

GH-46178: [R] source_node alignment warning#50120

Merged
thisisnic merged 1 commit into
apache:mainfrom
thisisnic:GH-46178-sourcenode
Jun 8, 2026
Merged

GH-46178: [R] source_node alignment warning#50120
thisisnic merged 1 commit into
apache:mainfrom
thisisnic:GH-46178-sourcenode

Conversation

@thisisnic
Copy link
Copy Markdown
Member

@thisisnic thisisnic commented Jun 7, 2026

Rationale for this change

There was a warning about unaligned nodes

What changes are included in this PR?

Make them get aligned

Are these changes tested?

Nah, but we should see a lack of warning on CI

Are there any user-facing changes?

Nope

Copilot AI review requested due to automatic review settings June 7, 2026 10:39
@thisisnic thisisnic requested a review from jonkeane as a code owner June 7, 2026 10:39
@thisisnic
Copy link
Copy Markdown
Member Author

@github-actions crossbow submit test-r-linux-sanitizers

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 7, 2026

⚠️ GitHub issue #46178 has been automatically assigned in GitHub to PR creator.

@github-actions github-actions Bot added Component: R awaiting committer review Awaiting committer review labels Jun 7, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the Arrow R Acero execution plan creation to avoid warnings about unaligned source buffers by configuring plan-wide alignment handling to reallocate unaligned buffers.

Changes:

  • Create an acero::QueryOptions instance when building an ExecPlan in R.
  • Set query_options.unaligned_buffer_handling to acero::UnalignedBufferHandling::kReallocate.
  • Pass the configured QueryOptions into acero::ExecPlan::Make(...).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread r/src/compute-exec.cpp
Comment on lines +51 to +54
acero::QueryOptions query_options;
query_options.unaligned_buffer_handling = acero::UnalignedBufferHandling::kReallocate;
auto plan = ValueOrStop(acero::ExecPlan::Make(
std::move(query_options), use_threads ? &threaded_context : gc_context()));
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Nope, this is pedantic, most of our users don't engage with this at this level. The real question isn't whether we should document it but whether there'll likely be user impact. Given we don't see these warnings particularly often on our tests, I'm going to assume minimal impact.

@github-actions github-actions Bot added awaiting changes Awaiting changes and removed awaiting committer review Awaiting committer review labels Jun 7, 2026
@thisisnic
Copy link
Copy Markdown
Member Author

@github-actions crossbow submit test-r-linux-sanitizers

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 8, 2026

Revision: bf17c95

Submitted crossbow builds: ursacomputing/crossbow @ actions-cb1dab0945

Task Status
test-r-linux-sanitizers GitHub Actions

Copy link
Copy Markdown
Member

@jonkeane jonkeane left a comment

Choose a reason for hiding this comment

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

I looked through the asan logs and on main (the latest crossbow run) I see:

2026-06-08T02:07:07.6984909Z /arrow/cpp/src/arrow/acero/source_node.cc:77: An input buffer was poorly aligned.  This could lead to crashes or poor performance on some hardware.  Please ensure that all Acero sources generate aligned buffers, or change the unaligned buffer handling configuration to silence this warning.

and I don't see that on the run on this PR. I will run this against our CRAN release crossbow job too, and if that passes, we are good to merge.

@jonkeane
Copy link
Copy Markdown
Member

jonkeane commented Jun 8, 2026

@github-actions crossbow submit test-r-macos-as-cran

@github-actions github-actions Bot added awaiting merge Awaiting merge and removed awaiting changes Awaiting changes labels Jun 8, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 8, 2026

Revision: bf17c95

Submitted crossbow builds: ursacomputing/crossbow @ actions-574fe09b49

Task Status
test-r-macos-as-cran GitHub Actions

@thisisnic
Copy link
Copy Markdown
Member Author

I looked through the asan logs and on main (the latest crossbow run) I see:

2026-06-08T02:07:07.6984909Z /arrow/cpp/src/arrow/acero/source_node.cc:77: An input buffer was poorly aligned.  This could lead to crashes or poor performance on some hardware.  Please ensure that all Acero sources generate aligned buffers, or change the unaligned buffer handling configuration to silence this warning.

and I don't see that on the run on this PR. I will run this against our CRAN release crossbow job too, and if that passes, we are good to merge.

Thanks loads for digging through those logs - I'd meant to do that myself!

@thisisnic thisisnic merged commit 222bfb7 into apache:main Jun 8, 2026
18 checks passed
@thisisnic thisisnic removed the awaiting merge Awaiting merge label Jun 8, 2026
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