Skip to content

Asynchronous materialization of samples view#7734

Merged
labkey-nicka merged 39 commits into
developfrom
fb_asyncSamplesTable
Jun 24, 2026
Merged

Asynchronous materialization of samples view#7734
labkey-nicka merged 39 commits into
developfrom
fb_asyncSamplesTable

Conversation

@XingY

@XingY XingY commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Rationale

On server start or after sample designer update, the first request to load the sample grid for a large sample type triggers a synchronous full table materialization, which can take a long time if the number of sample rows is large. If the user navigates away before it completes, the HTTP request is cancelled mid-flight, aborting the SELECT INTO. The materialized view is never populated — subsequent visits repeat the same blocking behavior indefinitely.

This change decouples view population from the request. When the materialized view is not ready (never built, or stale due to pending incremental updates), the request falls back immediately to direct JOINs and submits a background rebuild. The background task runs to completion regardless of user navigation, so the next visit uses the fast materialized path.

Changes

  • ExpMaterialTableImpl: replaced the synchronous getMaterializedSQL() call with the async-aware path.

Comment thread experiment/src/org/labkey/experiment/api/ExpMaterialTableImpl.java Outdated
Comment thread experiment/src/org/labkey/experiment/api/ExpMaterialTableImpl.java
Comment thread core/src/org/labkey/core/admin/AdminController.java Outdated
Comment thread api/src/org/labkey/api/data/MaterializedQueryHelper.java Outdated
@labkey-nicka labkey-nicka self-requested a review June 24, 2026 23:17
@labkey-nicka labkey-nicka merged commit 46da741 into develop Jun 24, 2026
7 of 8 checks passed
@labkey-nicka labkey-nicka deleted the fb_asyncSamplesTable branch June 24, 2026 23:19
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.

3 participants