Skip to content

Index datasets one at a time again in batch reindexes - #12774

Merged
landreev merged 7 commits into
developfrom
12773-batch-reindex-one-by-one
Oct 5, 2026
Merged

landreev merged 7 commits into
developfrom
12773-batch-reindex-one-by-one

Conversation

@ErykKul

@ErykKul ErykKul commented Oct 1, 2026

Copy link
Copy Markdown
Collaborator

What this PR does / why we need it:

Since #12712, a full reindex and a recursive collection reindex (also used when moving a collection) queue every dataset at once on the shared async pool, ahead of the indexing of new changes, exports and index time updates. This makes them index one dataset at a time again, as in 6.12.

Which issue(s) this PR closes:

Special notes for your reviewer:

The batch reads the dataset ids from the database, so there is no commit to wait for. MoveDataverseCommand still starts the recursive reindex before its own commit (see the TODO there), as in 6.12.

Suggestions on how to test this:

Run curl http://localhost:8080/api/admin/index and watch the log: datasets are indexed one by one after each "indexing dataset N of M" line. An edit made during the reindex is indexed right away. Unit test: IndexingAfterCommitTest.

Does this PR introduce a user interface change? If mockups are available, please link/include them here:

No.

Is there a release notes update needed for this change?:

No, it fixes #12712, which is not released yet.

Additional documentation:

None.

@github-actions github-actions Bot added FY27 Sprint 6 FY27 Sprint 6 (2026-09-09 - 2026-09-23) FY27 Sprint 7 FY27 Sprint 7 (2026-09-23 - 2026-10-07) Size: 3 A percentage of a sprint. 2.1 hours. Type: Bug a defect labels Oct 1, 2026
@ErykKul ErykKul added this to the 6.12.1 milestone Oct 1, 2026
@coveralls

coveralls commented Oct 1, 2026 •

Copy link
Copy Markdown

Coverage Status

coverage: 25.55% (+0.02%) from 25.529% — 12773-batch-reindex-one-by-one into develop

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

github-actions Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Test Results

407 tests   392 ✅  24m 7s ⏱️
 55 suites   15 💤
 55 files      0 ❌

Results for commit cc18d13.

♻️ This comment has been updated with latest results.

@github-actions

This comment has been minimized.

With flush mode AUTO the index job checked all loaded entities for changes
before each term lookup. The job never changes them, so COMMIT is safe.

Refs: #12765
@github-actions

This comment has been minimized.

@pdurbin pdurbin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Tests are passing. Approved.

@sonarqubecloud

sonarqubecloud Bot commented Oct 2, 2026

Copy link
Copy Markdown

@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown

📦 Pushed preview images as

ghcr.io/gdcc/dataverse:12773-batch-reindex-one-by-one
ghcr.io/gdcc/configbaker:12773-batch-reindex-one-by-one

🚢 See on GHCR. Use by referencing with full name as printed above, mind the registry name.

@landreev

landreev commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Interesting/impressive results from a full reindex (the same database snapshot that was used for the 6.12 release candidate test):

31.5 hours total (vs 40.5 hours in 6.12!)

start:

[2026-10-02T19:20:49.764+0000] [Payara 7.2026.9] [INFO] [] [edu.harvard.iq.dataverse.sea
rch.IndexBatchServiceBean] [tid: _ThreadID=265 _ThreadName=__ejb-thread-pool1] [timeMill
is: 1790968849764] [levelValue: 800] [[
  indexing dataverse 1 of 13958 (id=1, persistentId=harvard)]]

end:

[2026-10-04T02:52:27.084+0000] [Payara 7.2026.9] [INFO] [] [edu.harvard.iq.dataverse.search.IndexBatchServiceBean] [tid: _ThreadID=265 _ThreadName=__ejb-thread-pool1] [timeMillis: 1791082347084] [levelValue: 800] [[
  13958 dataverses and 330841 datasets indexed. index all took 113497375 milliseconds. Solr index was not cleared before indexing.
]]

The result checked in in the usual place.

I am not sure I can properly explain where the 9 hours worth of savings (!!) came from myself. So I would appreciate a technical explanation.

But it is fairly clear that it is the datasets with large numbers of files that got much faster to reindex.
Just looking at the last 2 datasets - the monsters with 50K and 64K files respectively:

6.12:

[2026-09-18T14:43:57.318+0000] [Payara 7.2026.8] [INFO] [] [edu.harvard.iq.dataverse.searc
h.IndexBatchServiceBean] [tid: _ThreadID=294 _ThreadName=__ejb-thread-pool1] [timeMillis: 
1789742637318] [levelValue: 800] [[
  indexing dataset 330840 of 330841 (id=10293818)]]

[2026-09-18T14:48:31.374+0000] [Payara 7.2026.8] [INFO] [] [edu.harvard.iq.dataverse.searc
h.IndexBatchServiceBean] [tid: _ThreadID=294 _ThreadName=__ejb-thread-pool1] [timeMillis: 
1789742911374] [levelValue: 800] [[
  indexing dataset 330841 of 330841 (id=8153399)]]

[2026-09-18T14:57:12.094+0000] [Payara 7.2026.8] [INFO] [] [edu.harvard.iq.dataverse.search.IndexBatchServiceBean] [tid: _ThreadID=294 _ThreadName=__ejb-thread-pool1] [timeMillis: 1789743432094] [levelValue: 800] [[
  done iterating through all datasets]]

6.12.1:

[2026-10-04T02:50:16.726+0000] [Payara 7.2026.9] [INFO] [] [edu.harvard.iq.dataverse.search.IndexBatchServiceBean] [tid: _ThreadID=265 _ThreadName=__ejb-thread-pool1] [timeMillis: 1791082216726] [levelValue: 800] [[
  indexing dataset 330840 of 330841 (id=10293818)]]

[2026-10-04T02:50:34.813+0000] [Payara 7.2026.9] [INFO] [] [edu.harvard.iq.dataverse.search.IndexBatchServiceBean] [tid: _ThreadID=265 _ThreadName=__ejb-thread-pool1] [timeMillis: 1791082234813] [levelValue: 800] [[
  indexing dataset 330841 of 330841 (id=8153399)]]

[2026-10-04T02:52:27.079+0000] [Payara 7.2026.9] [INFO] [] [edu.harvard.iq.dataverse.search.IndexBatchServiceBean] [tid: _ThreadID=265 _ThreadName=__ejb-thread-pool1] [timeMillis: 1791082347079] [levelValue: 800] [[
  done iterating through all datasets]]

i.e., 4.5 min. and 8.5 min. vs 15 sec. and 2 min. respectively (!!).

I am satisfied with what I've seen. Merging.

@landreev
landreev merged commit 5efb4f9 into develop Oct 5, 2026
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

FY27 Sprint 6 FY27 Sprint 6 (2026-09-09 - 2026-09-23) FY27 Sprint 7 FY27 Sprint 7 (2026-09-23 - 2026-10-07) Size: 3 A percentage of a sprint. 2.1 hours. Type: Bug a defect

Projects

Status: Done 🧹

Development

Successfully merging this pull request may close these issues.

Batch reindex queues every dataset at once since #12712

5 participants