Skip to content

misc: use-after-move vlog fixes & remove NOLINTNEXTLINE#30227

Merged
WillemKauf merged 6 commits intoredpanda-data:devfrom
WillemKauf:uamove_fixes
Apr 20, 2026
Merged

misc: use-after-move vlog fixes & remove NOLINTNEXTLINE#30227
WillemKauf merged 6 commits intoredpanda-data:devfrom
WillemKauf:uamove_fixes

Conversation

@WillemKauf
Copy link
Copy Markdown
Contributor

Picked out of #30202. The changes to vlog() there must have started picking up on some use-after-moves that aren't currently picked up by the linter because of NOLINTNEXTLINE.

It's a little curious why NOLINTNEXTLINE is there anyways- lets remove it.

Backports Required

  • none - not a bug fix
  • none - this is a backport
  • none - issue does not exist in previous branches
  • none - papercut/not impactful enough to backport
  • v26.1.x
  • v25.3.x
  • v25.2.x

Release Notes

  • none

Copilot AI review requested due to automatic review settings April 18, 2026 16:37
@github-actions github-actions Bot added area/redpanda area/wasm WASM Data Transforms labels Apr 18, 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 adjusts several vlog() callsites to avoid bugprone-use-after-move warnings (by snapshotting values before moving the source object) and removes NOLINTNEXTLINE suppressions from the vlog macro definitions.

Changes:

  • Snapshot/memoize values (e.g., offsets, sizes, group_id) before moving the underlying objects used to compute them.
  • Update log formatting arguments to use the snapshotted values after moves.
  • Remove NOLINTNEXTLINE comments from src/v/base/vlog.h macro definitions.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/v/transform/rpc/client.cc Cache ids.size() before ids is moved into an async RPC lambda; use cached size in logs.
src/v/storage/mvlog/segment_appender.cc Cache batch offsets before moving batch data into the entry body; use cached offsets in logs.
src/v/kafka/server/group_manager.cc Cache group_id before moving kafka_r into offset_commit; use cached id in subsequent logs.
src/v/cluster/rm_stm.cc Cache b.base_offset() before moving b into read_fence_batch; use cached offset in log.
src/v/cluster/log_eviction_stm.cc Log using rp_start_offset/kafka_start_offset variables instead of moved-from val.
src/v/base/vlog.h Remove NOLINTNEXTLINE suppressions from vlog macro definitions.
Comments suppressed due to low confidence (1)

src/v/kafka/server/group_manager.cc:1081

  • first_error is initialized to error_code::none but is only assigned inside if (first_error != error_code::none), so it will never capture the first encountered partition error. This makes the later if (first_error != error_code::none) check ineffective and can cause restore to report success despite per-partition errors. Flip the condition (or otherwise set first_error on the first error) so errors are surfaced correctly.
                      group_id,
                      offsets_ntp,
                      kafka_p.error_code);
                    if (first_error != error_code::none) {
                        first_error = kafka_p.error_code;
                    }

@WillemKauf WillemKauf requested review from a team, BenPope, andrwng and dotnwat and removed request for a team April 18, 2026 17:31
@vbotbuildovich
Copy link
Copy Markdown
Collaborator

CI test results

test results on build#83360
test_status test_class test_method test_arguments test_kind job_url passed reason test_history
FLAKY(PASS) KgoVerifierMultiNodeSelfTest test_kgo_verifier_multi_node_autoassign null integration https://buildkite.com/redpanda/redpanda/builds/83360#019da192-f0e6-4a3c-82c4-29bfa745c5e2 10/11 Test PASSES after retries.No significant increase in flaky rate(baseline=0.0000, p0=1.0000, reject_threshold=0.0100. adj_baseline=0.1000, p1=0.3487, trust_threshold=0.5000) https://redpanda.metabaseapp.com/dashboard/87-tests?tab=142-dt-individual-test-history&test_class=KgoVerifierMultiNodeSelfTest&test_method=test_kgo_verifier_multi_node_autoassign

@WillemKauf WillemKauf merged commit 7c4ad8b into redpanda-data:dev Apr 20, 2026
24 checks passed
Copy link
Copy Markdown
Member

@dotnwat dotnwat left a comment

Choose a reason for hiding this comment

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

wow nice!

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

Labels

area/redpanda area/wasm WASM Data Transforms

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants