Skip to content

Fix fast last query handling for empty last-cache entries#17742

Open
Caideyipi wants to merge 1 commit into
masterfrom
fix-fast-last-empty-cache-placeholder
Open

Fix fast last query handling for empty last-cache entries#17742
Caideyipi wants to merge 1 commit into
masterfrom
fix-fast-last-empty-cache-placeholder

Conversation

@Caideyipi
Copy link
Copy Markdown
Collaborator

Description

Motivation

Fast last query cache may contain TableDeviceLastCache.PLACEHOLDER_EMPTY_COLUMN for measurements that have no last
value. Some cache-hit response paths only checked whether the cached value was null, so the placeholder entry could
be handled as a normal cached value.

Modification

This PR treats PLACEHOLDER_EMPTY_COLUMN as an empty last-cache entry in fast last query response building.

Changes include:

  • Skip placeholder empty-column entries when building REST fast last query responses.
  • Treat placeholder empty-column entries the same as null-value cache entries in
    executeFastLastDataQueryForOneDeviceV2.
Key changed/added classes in this PR
  • ClientRPCServiceImpl
  • RestApiServiceImpl

This PR has:

  • been self-reviewed.
    • concurrent read
    • concurrent write
    • concurrent read and write
  • added documentation for new or modified features or behaviors.
  • added Javadocs for most classes and all non-trivial methods.
  • added or updated version, license, or notice information
  • added comments explaining the "why" and the intent of the code wherever would not be obvious
    for an unfamiliar reader.
  • added unit tests or modified existing tests to cover new code paths, ensuring the threshold
    for code coverage.
  • added integration tests.
  • been tested in a test IoTDB cluster.

Key changed/added classes (or packages if there are too many classes) in this PR

@sonarqubecloud
Copy link
Copy Markdown

@codecov
Copy link
Copy Markdown

codecov Bot commented May 22, 2026

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 40.59%. Comparing base (c1bbbd1) to head (3f35dc9).

Files with missing lines Patch % Lines
.../db/protocol/thrift/impl/ClientRPCServiceImpl.java 0.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master   #17742      +/-   ##
============================================
+ Coverage     40.47%   40.59%   +0.12%     
  Complexity     2574     2574              
============================================
  Files          5179     5179              
  Lines        349942   349943       +1     
  Branches      44737    44738       +1     
============================================
+ Hits         141631   142072     +441     
+ Misses       208311   207871     -440     

☔ 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.

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.

1 participant