CDM cache warming still fails when cache.achilles.usePersonCount=false (missing `cc` alias in getBatchConceptRecordCount.sql)
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 82/100
調査の方向性
まず getBatchConceptRecordCount.sql を確認し、そのテーブルエイリアスを getBatchConceptRecordPersonCount.sql のものと比較します。次に CDMCacheBatchService.save を調べ、person count が null の場合の処理を確認します。cache.achilles.usePersonCount=false にして、すでに cdm_cache にある concept を含めてキャッシュをウォームアップし、問題を再現します。ウォームアップ時に SQL エラーや null のアンボクシング失敗を起こさずに record count が読み込まれれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Expected behavior
With cache.achilles.usePersonCount=false, warming the CDM results cache (GET /cdmresults/{sourceKey}/warmCache, the startup/cron warming job) loads record counts from achilles_result_concept_count into cdm_cache, the same way it does with usePersonCount=true.
Actual behavior
The placeholder fix for #2517 (a9720e7b) is in, but the batch query still cannot run. getBatchConceptRecordCount.sql uses cc.concept_id in the select list, join and WHERE clause, but never declares the cc alias:
select cc.concept_id, record_count, descendant_record_count
from @resultTableQualifier.achilles_result_concept_count
join @vocabularyTableQualifier.concept c on cc.concept_id = c.concept_id
WHERE cc.concept_id >= @conceptIdentifierMin and cc.concept_id <= @conceptIdentifierMax
The person-count variant (getBatchConceptRecordPersonCount.sql) declares the alias, so only usePersonCount=false is affected. On PostgreSQL the warm job logs:
ERROR: missing FROM-clause entry for table "cc" at character 153
ERROR o.o.w.cdmresults.service.CDMCacheService - Failed to warm cache ... Exception: PreparedStatementCallback; bad SQL grammar [select cc.concept_id, record_count, descendant_record_count ...
SQL Server reports The multi-part identifier "cc.concept_id" could not be bound. The error is caught and logged in CDMCacheService.warm, so nothing gets cached and no error reaches the user.
There is a second problem on the same path. CDMCacheBatchService.save decides whether a cached concept changed by unboxing all four counts into a long[]. With usePersonCount=false the person counts are null, so re-warming any concept that is already in cdm_cache throws NullPointerException: Cannot invoke "java.lang.Long.longValue()" because the return value of "...CDMCacheEntity.getPersonCount()" is null.
Steps to reproduce behavior
- Set
cache.achilles.usePersonCount=false(for example, for a results schema whoseachilles_result_concept_counttable has no person count columns, see #2239). - Call
GET /WebAPI/cdmresults/{sourceKey}/warmCache(or enable cache warming). - The job logs "Failed to warm cache" with the SQL error above, and
cdm_cachestays empty for the source.
Environment: WebAPI master (817bae80) and master-2.15; reproduced against embedded PostgreSQL 15 in the WebAPI test harness, JDK 21.
- 主要言語
- Java
- スター
- 153
- フォーク
- 187
- 平均マージ
- 2日 12時間
- マージ済み PR(30日)
- 13
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
OHDSI/WebAPI のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
GET /conceptset/{id}/expression returns items in nondeterministic order (query has no ORDER BY)オープン
難易度 3/5 1〜2日 初心者へのやさしさ 67/100
OHDSI/WebAPI#2543 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
OHDSI/WebAPI#2513 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
hiero-ledger/hiero-sdk-java#3010 ·
メンテナーはふだん 1 日以内に返信
-
Optimize consumer version heatmap aggregation to avoid repeated scans対応中かも @praykaria31 が今日担当しました。 オープンtype/enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
Apicurio/apicurio-registry#10662 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
a:false-positive
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
メンテナーはふだん 1 日以内に返信
-
status: waiting-for-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
spring-projects/spring-boot#52347 ·
メンテナーはふだん 2 日以内に返信
-
bug untriaged
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
opensearch-project/opensearch-migrations#3480 ·
メンテナーはふだん 2 日以内に返信