Skip to content

Remove unnecessary clone() calls from refactored update worker#7704

Closed
Copilot wants to merge 2 commits intorefactor-update-workersfrom
copilot/sub-pr-7642
Closed

Remove unnecessary clone() calls from refactored update worker#7704
Copilot wants to merge 2 commits intorefactor-update-workersfrom
copilot/sub-pr-7642

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Dec 6, 2025

All Submissions:

  • Contributions should target the dev branch. Did you create your branch from dev?
  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?

Changes to Core Features:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your core changes, as applicable?
  • Have you successfully ran tests with your changes locally?

The refactoring PR introduced explicit .clone() calls in update_worker_internal that weren't in the original code, changing Arc reference counting behavior from move semantics to clone-on-pass.

Fixed:

  • Removed unnecessary .clone() on update_operation_lock and update_tracker parameters
  • Restored original move semantics when passing Arc types to CollectionUpdater::update()

Before:

CollectionUpdater::update(
    &segments,
    op_num,
    operation,
    update_operation_lock.clone(),  // Extra ref count increment
    update_tracker.clone(),          // Extra ref count increment
    &hw_measurements.get_counter_cell(),
);

After:

CollectionUpdater::update(
    &segments,
    op_num,
    operation,
    update_operation_lock,  // Move ownership (original behavior)
    update_tracker,         // Move ownership (original behavior)
    &hw_measurements.get_counter_cell(),
);

All moved functions now preserve original logic. Visibility changes and Self:: qualifications remain correct for cross-module access.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Dec 6, 2025

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • esm.ubuntu.com
    • Triggering command: /usr/lib/apt/methods/https /usr/lib/apt/methods/https /home/REDACTED/work/qdrant/qdrant/target/debug/build/segment-b9905a5a8b736df7/build_script_build-b9905a5a8b736df7.8b7x1tunkcw6lrt4ou8wtiorn.1lwrzle.rcgu.o /home/REDACTED/work/qdrant/qdrant/target/debug/build/segment-b9905a5a8b736df7/build_script_build-b9905a5a8b736df7.8rlihednvpowexv4gen61lywu.1lwrzle.rcgu.o /home/REDACTED/work/qdrant/qdrant/target/debug/build/segment-b9905a5a8b736df7/build_script_build-b9905a5a8b736df7.8t8jvqkk26561saktdxe550iv.1lwrzle.rcgu.o /home/REDACTED/work/qdrant/qdrant/target/debug/build/segment-b9905a5a8b736df7/build_script_build-b9905a5a8b736df7.aetin78f3v1mdxdpj90hz9121.1lwrzle.rcgu.o /home/REDACTED/work/qdrant/qdrant/target/debug/build/segment-b9905a5a8b736df7/build_script_build-b9905a5a8b736df7.ak3tkjbki3juz999j6b7wvug7.1lwrzle.rcgu.o /home/REDACTED/work/qdrant/qdrant/target/debug/build/segment-b9905a5a8b736df7/build_script_build-b9905a5a8b736df7.cs6l3zdtrr35ptlagyic0w5cw.1lwrzle.rcgu.o 03d/out/pbtime/descriptors.bin /home/REDACTED/work/qdrant/qdrant/target/debug/build/segment-b9905a5a8b736df7/build_script_build-b9905a5a8b736df7.e7lnz7w1u0pt4rof25mkvoaji.1lwrzle.rcgu.o /home/REDACTED/work/qdrant/qdrant/target/debug/build/segment-b9905a5a8b736df7/build_sc�� /home/REDACTED/work/qdrant/qdrant/target/debug/build/segment-b9905a5a8b736df7/build_script_build-b9905a5a8b736df7.dhzvztz8m9wsx8ogtqkot1jz5.1lwrzle.rcgu.o -Wl,--as-needed 8e3.�� 64-REDACTED-linux-gnu/lib/libproc_macro-c10eb12c9df63a3c.rlib 64-REDACTED-linux-gnu/lib/librustc_literal_escaper-0753a5fa3f28340e.rlib 969ee7f03ff79b27/build_script_build-969ee7f03ff79b27.19swnfcsqo3bo890bmcggedzn.0j39own.rcgu.o 969ee7f03ff79b27cc 969ee7f03ff79b27-m64 969ee7f03ff79b27/tmp/rustcCciIVP/symbols.o 969ee7f03ff79b27/home/REDACTED/work/qdrant/qdrant/target/debug/build/segment-b9905a5a8b736df7/build_script_build-b9905a5a8b736df7.07p5g13jp7hunjy1vuztaapr2.1lwrzle.rcgu.o (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title [WIP] Refactor worker files for better organization Remove unnecessary clone() calls from refactored update worker Dec 6, 2025
Copilot AI requested a review from generall December 6, 2025 02:02
@generall generall closed this Dec 6, 2025
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.

2 participants