[Archivesspace_Users_Group] Method to Pause Indexer during Job Run?

Andrew Morrison andrew.morrison at bodleian.ox.ac.uk
Wed Feb 19 08:32:43 EST 2020


I'd be interested in hearing if you get this to work, because it could be useful in fixing this issue:

https://archivesspace.atlassian.net/browse/ANW-902

Also, if you're making a truly mammoth update, which will be followed by a re-index of nearly everything, you might want to consider increasing the AppConfig[:indexer_solr_timeout_seconds] config setting. It may be our infrastructure, but I've found that Solr commit's phase can take so long that ArchivesSpace times out before it finishes, causing it to start the whole re-index again from scratch. We've set it to 1800 to avoid this, but YMMV.

Andrew.

________________________________
From: archivesspace_users_group-bounces at lyralists.lyrasis.org <archivesspace_users_group-bounces at lyralists.lyrasis.org> on behalf of Joshua D. Shaw <Joshua.D.Shaw at dartmouth.edu>
Sent: 19 February 2020 13:05
To: Archivesspace Users Group <archivesspace_users_group at lyralists.lyrasis.org>
Subject: Re: [Archivesspace_Users_Group] Method to Pause Indexer during Job Run?

Thanks, James. I glanced at that, but somehow didn't realize those were endpoints I could hit. I'll give it a go!

Joshua

________________________________
From: archivesspace_users_group-bounces at lyralists.lyrasis.org <archivesspace_users_group-bounces at lyralists.lyrasis.org> on behalf of James Bullen <james at hudmol.com>
Sent: Tuesday, February 18, 2020 7:16 PM
To: Archivesspace Users Group <archivesspace_users_group at lyralists.lyrasis.org>
Subject: Re: [Archivesspace_Users_Group] Method to Pause Indexer during Job Run?


Hi Joshua,

I haven’t used it, but I see these endpoints in indexer/app/main.rb

  get "/" do
    if IndexerCommon.paused?
      "Indexers paused until #{IndexerCommon.class_variable_get(:@@paused_until)}"
    else
      "Running every #{AppConfig[:solr_indexing_frequency_seconds].to_i} seconds. "
    end
  end

  # this pauses the indexer so that bulk update and migrations can happen
  # without bogging down the server
  put "/" do
    duration = params[:duration].nil? ? 900 : params[:duration].to_i
    IndexerCommon.pause duration
    "#{IndexerCommon.class_variable_get(:@@paused_until)}"
  end


Seems to do what you want.


Cheers,
James


On Feb 19, 2020, at 6:29 AM, Joshua D. Shaw <Joshua.D.Shaw at dartmouth.edu<mailto:Joshua.D.Shaw at dartmouth.edu>> wrote:

Hey all-

I writing a job that may take a *long* time (hours) to complete which will be updating a *lot* of AO records. I'm wondering if there's a way to pause the Indexer during a job so that I can let the Indexer do its thing*after* the job completes. I know I can toggle the AppConfig value for the indexer and do a stop/start for the app, but ideally I'd like to do the pause/resume of the Indexer while the job runs.

I could also set this up as a migration, but the updates include a bunch of tables (I'm adding an instance to AOs which meet certain criteria) and I'd prefer to use the API to do things to be safe.

Any thoughts on pausing the Indexer during a job, or do I bite the bullet and do this as a migration?

Thanks!
Joshua

___________________
Joshua Shaw (he, him)
Technology Coordinator
Rauner Special Collections Library & Digital Library Technologies Group
Dartmouth College
603.646.0405
!DSPAM:5e4c3b1e193891489818497! _______________________________________________
Archivesspace_Users_Group mailing list
Archivesspace_Users_Group at lyralists.lyrasis.org<mailto:Archivesspace_Users_Group at lyralists.lyrasis.org>
http://lyralists.lyrasis.org/mailman/listinfo/archivesspace_users_group<https://nam12.safelinks.protection.outlook.com/?url=http%3A%2F%2Flyralists.lyrasis.org%2Fmailman%2Flistinfo%2Farchivesspace_users_group&data=02%7C01%7Cjoshua.d.shaw%40dartmouth.edu%7C16cec040dfaa4f44eaa908d7b4d10635%7C995b093648d640e5a31ebf689ec9446f%7C0%7C0%7C637176682159514123&sdata=XU3deEry67Xzb8G%2BTEhiTGcxg646DhE3VFmNjZjWNvw%3D&reserved=0>


!DSPAM:5e4c3b1e193891489818497!

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lyralists.lyrasis.org/pipermail/archivesspace_users_group/attachments/20200219/0a13d7ad/attachment.html>


More information about the Archivesspace_Users_Group mailing list