Skip to content

GH Issue 1941: Optionally rebuild sample type caches at startup - #8386

Open
labkey-jeckels wants to merge 4 commits into
release26.11-SNAPSHOTfrom
26.11_fb_warm_sample_caches_1941
Open

labkey-jeckels wants to merge 4 commits into
release26.11-SNAPSHOTfrom
26.11_fb_warm_sample_caches_1941

Conversation

@labkey-jeckels

@labkey-jeckels labkey-jeckels commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Rationale

Adds an opt-in setting that rebuilds the materialized sample type caches in the background at startup, so large sample types aren't slow for the first several minutes after a restart (GH Issue 1941). Today each cache is rebuilt only on its first read, one sample type at a time, and every read until then runs the uncached query; on a server with multi-million-row sample types this pushed API clients past their timeouts. The setting is off by default for 26.11.

Changes

  • New optional feature "Rebuild sample type caches at startup", off by default
  • When enabled, every sample type's cache is queued for a background rebuild after startup, and immediately when the feature is switched on
  • Smaller sample types are queued first so one large type doesn't delay the rest
  • A sample type whose table can't be built is logged and skipped rather than stopping the others
  • Integration test covering the queue order and the background build
  • Update materialized table timeout to 15 days

Adds an optional feature, off by default, that materializes every sample type in the background at startup and when enabled, so the first reads of large sample types after a restart don't fall back to the slow uncached query.
@labkey-jeckels labkey-jeckels self-assigned this Nov 24, 2026
@labkey-jeckels labkey-jeckels added this to the 26.11 milestone Nov 24, 2026
A substring check failed when another indexed integer (e.g. 3041) contained the removed value 41.
TableSelector rejects Set.of() for getArrayList, so materializeAllAsync threw before queueing anything.
Object tokens = last.get(SearchService.PROPERTY.identifiersMed.toString());
assertTrue("T1's last document lost its TextField value: " + outcome, String.valueOf(tokens).contains("alpha"));
assertFalse("T1's last document kept the removed field's value: " + outcome, String.valueOf(tokens).contains("41"));
List<String> tokens = last.get(SearchService.PROPERTY.identifiersMed.toString()) instanceof List<?> list

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@labkey-jeckels
labkey-jeckels marked this pull request as ready for review November 25, 2026 17:14
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.

2 participants