[BUG] Cosmos P1: Non-streaming vector TOP queries silently discard winning results

未关闭
#51,133 0 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
45/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
azure, java
领域
databases

调研方向

Read DocumentQueryExecutionContextFactory.java around lines 525–536 and NonStreamingOrderByUtils.java around lines 95–109 to trace how fetch-page sizing affects the non-streaming merge’s candidate limit. Reproduce the six-range skewed TOP 60 case and compare exact top-K membership with an unrestricted reference result. Done when all 60 winning results are retained and regression coverage verifies membership through the factory and query pipeline.

由索引模型根据 Issue 内容生成。

描述

Client Cosmos

Describe the bug
Alan Zimmer's November 6, 2026 audit of com.azure:azure-cosmos:4.84.0-beta.1 reports that a streaming ORDER BY fetch-page optimization also reduces the non-streaming merge's candidate-retention limit. With six ranges and TOP 60, that limit becomes 50. If winning results are concentrated in one range, valid candidates are discarded, yielding too few results or worse matches. Reported priority: P1; silent incorrect query results.

Exception or Stack Trace
N/A; results are silently incorrect.

To Reproduce
Execute a non-streaming vector TOP 60 query across six skewed ranges, with the winning candidates concentrated in one range. Exercise the factory and query pipeline and compare exact top-K membership against an unrestricted reference result.

Code Snippet
No complete executable snippet was supplied. Reported locations: DocumentQueryExecutionContextFactory.java:525-536 and NonStreamingOrderByUtils.java:95-109 in the audited source.

Expected behavior
Fetch-page sizing must not reduce the number of candidates retained for the global top-K merge; all 60 winning results must be retained and returned.

Screenshots
N/A.

Setup (please complete the following information):

  • OS: Not reported.
  • IDE: Not reported.
  • Library/Libraries: com.azure:azure-cosmos:4.84.0-beta.1.
  • Java version: Not reported.
  • App Server/Environment: Non-streaming vector query over six ranges.
  • Frameworks: Not reported.

Dependency mismatch: Not indicated; dependency tree/logs were not supplied.

Additional context
Proposed fix from the audit: separate fetch-page sizing from candidate retention, or exclude non-streaming queries from the streaming optimization.

Regression coverage: exercise the factory/pipeline with six skewed ranges and verify exact top-K membership, not only result count.

Reported reproduction: compiled current-source query components retained 50 results versus 60 with the correct limit. The probe supplied the factory-derived limit and was not a full factory integration test; cached supporting dependencies were used. No live Cosmos calls or full SDK test suite were run, and no repository files were changed. This issue tracks validation and implementation of the proposed fix, not an already-applied fix. Alan recommended addressing this and the failed change-feed initialization finding first.

Information Checklist

  • Bug Description Added
  • Repro Steps Added
  • Setup information Added
主要语言
Java
星标
2.6k
派生
2.2k
平均合并
2 天 2 小时
30 天内合并 PR
257

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

Azure/azure-sdk-for-java 的其他 Issue

查看 Azure/azure-sdk-for-java 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。