Skip to content

columnar_cache.c is effectively untested (6.7% lines, 2.8% branches) #282

Description

@jdatcmd

Found by the first full coverage run (#281), which is what that report is for.

Across every suite on PostgreSQL 17, columnar_cache.c sits an order of magnitude
below the rest of the tree:

file lines functions branches
columnar_cache.c 6.7% (90) 25.0% (8) 2.8% (36)
next lowest (columnar_compression.c) 83.2% 83.3% 54.1%
tree total 93.1% 94.0% 71.2%

So roughly 84 of its 90 lines and 35 of its 36 branches are never executed by any
suite.

Why this matters more than the number

The column cache sits on the read path. Code that no test executes is code whose
behaviour is unknown, and a cache is a place where the interesting behaviour is in
the paths a simple test does not reach: eviction, invalidation on write,
memory-context lifetime, and reuse across scans in one command. native_fetch_cache
exists, so something exercises the cache, but 2.8% branch coverage says it
exercises one path through it.

Worth checking before deciding what to write:

  • whether the GUC that enables it is off by default in the suites, in which case
    almost everything here is dead in test and the fix is to turn it on somewhere;
  • whether the uncovered lines are an eviction path that only triggers above a size
    threshold no suite reaches;
  • whether any of it is genuinely dead code that should be removed rather than
    tested, which the report cannot distinguish from untested code.

The last one matters: 6.7% could mean "badly tested" or "mostly unreachable", and
those have opposite remedies.

Not a blocker

No defect is claimed here. Every suite passes and the sanitizer gate is clean;
this is an absence of evidence rather than evidence of a problem. Filing it so the
first thing the coverage report found does not get lost, which is the failure mode
that made native_scale dark.

Reproduce with test/run_coverage.sh /path/to/pg_config, or read the artifact
from the nightly run.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions