Skip to content

Conversation

@ButterBright
Copy link
Member

@ButterBright ButterBright commented Jan 15, 2026

This PR fixes the following issues:

  • Data being written to the wrong shard.

  • Failure to sort stream in descending order.

  • Shard-level inverted index filter being overwritten during query execution due to duplicated part IDs.

  • Update the CHANGES log.

@ButterBright ButterBright added the bug Something isn't working label Jan 15, 2026
@ButterBright ButterBright added this to the 0.10.0 milestone Jan 15, 2026
Copy link
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 fixes a critical bug where data was being written to the wrong shard due to missing shard ID validation during table lookup. Additionally, it corrects related stream query issues including improper sort condition logic and incorrect filter index key types.

Changes:

  • Fixed shard ID validation in write path for trace, stream, and measure modules to ensure data is written to the correct shard
  • Improved error handling in liaison layers by waiting for publish responses and continuing on failures
  • Corrected stream query sort condition and filter index key type

Reviewed changes

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

Show a summary per file
File Description
banyand/trace/write_standalone.go Added shardID check in table lookup and moved shardID extraction earlier for proper initialization
banyand/trace/write_liaison.go Enhanced error handling by capturing publish futures and logging errors on both publish and get failures
banyand/stream/write_standalone.go Added shardID check in table lookup and moved shardID extraction earlier for proper initialization
banyand/stream/write_liaison.go Added shardID check in table lookup, moved extraction earlier, and enhanced error handling with futures
banyand/stream/query.go Fixed sort condition by removing incorrect nil check for Order.Index
banyand/stream/block_scanner.go Changed filterIndex map key from part ID (uint64) to part pointer for correct filter association
banyand/measure/write_standalone.go Added shardID check in table lookup, moved extraction earlier, and updated newDpt to accept shardID parameter
banyand/measure/write_liaison.go Updated newDpt call to pass shardID parameter directly
CHANGES.md Added changelog entry for the bug fix

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

@codecov-commenter
Copy link

codecov-commenter commented Jan 15, 2026

Codecov Report

❌ Patch coverage is 44.82759% with 16 lines in your changes missing coverage. Please review.
✅ Project coverage is 47.13%. Comparing base (3530dd9) to head (86daa7f).
⚠️ Report is 111 commits behind head on main.

Files with missing lines Patch % Lines
banyand/stream/write_liaison.go 0.00% 8 Missing ⚠️
banyand/trace/write_liaison.go 0.00% 6 Missing ⚠️
banyand/measure/write_liaison.go 0.00% 1 Missing ⚠️
banyand/stream/query.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #944      +/-   ##
==========================================
+ Coverage   45.97%   47.13%   +1.15%     
==========================================
  Files         328      383      +55     
  Lines       55505    59445    +3940     
==========================================
+ Hits        25520    28021    +2501     
- Misses      27909    28810     +901     
- Partials     2076     2614     +538     
Flag Coverage Δ
banyand 49.58% <44.82%> (?)
bydbctl 81.91% <ø> (?)
fodc 79.32% <ø> (?)
integration-distributed 80.00% <ø> (?)
pkg 29.21% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@hanahmily hanahmily merged commit c835ea5 into apache:main Jan 19, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants