Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In-progress Solr containerization and reindexing work #1176

Merged
merged 29 commits into from
Apr 27, 2017
Merged

Conversation

jywarren
Copy link
Member

@jywarren jywarren commented Jan 6, 2017

@icarito and I are working on this branch to resolve Solr issues through better containerization; working on this in #1112.

This will show a pass/fail based on any commits pushed to this branch:

http://staging.laboratoriopublico.org/job/Plots-Solr/

http://branch1.laboratoriopublico.org/

Look for success here:

http://branch1.laboratoriopublico.org/searches/test

@jywarren
Copy link
Member Author

OK - Sebastian, my suspicion was correct -- this didn't pass, due to our new test, but it didn't trigger a failure for Travis. That's in https://github.com/jywarren/web/issues/70

@jywarren
Copy link
Member Author

@ananyo2012 - this check failed because we added new code that's not as thoroughly covered, it say, but I introduced one new controller action and wrote a test for it. Would I have to put that test in the conventional /test/functional/ as well (or rather than in /test/solr/, where I put it?) to get the check to pass?

@jywarren
Copy link
Member Author

jywarren commented Feb 2, 2017

@ananyo2012 - just wondering about this failed check and if we need to either:

a. make Coveralls aware of our solr tests
b. duplicate the test from the solr test to somewhere Coveralls will see?

Thanks!

@ananyo2012
Copy link
Member

@jywarren I am not quite sure why the coverage decreased. Have to check how coveralls calculates the coverage. Maybe its because the solr tests weren't taken into account so far and now that they are being tested there is a significant drop in the coverage so we need more solr test. Or maybe it is due to less tests for drupal_node model as I see a drop in the coverage of drupal_node.rb

@jywarren
Copy link
Member Author

jywarren commented Feb 2, 2017 via email

@PublicLabBot
Copy link

PublicLabBot commented Feb 14, 2017

3 Messages
📖 @jywarren Thank you for your pull request! I’m here to help with some tips and recommendations. Please take a look at the list provided and help us review and accept your contribution!
📖 This pull request doesn’t link to a issue number. Please refer to the issue it fixes (if any) in the format: Fixes #123.
📖 You have added multiple commits. It’s helpful to squash them if the individual changes are small.

Generated by 🚫 Danger

@icarito
Copy link
Member

icarito commented Feb 14, 2017

Hi Jeff,
Looks like finally we got it to reindex. Do not merge sunspot.yml, or we will have to remember to disable it in production. Let's test it first in http://branch1.laboratoriopublico.org/ - it's running now.

@jywarren
Copy link
Member Author

Wow!!! Very cool. Checking now.

@jywarren
Copy link
Member Author

I see a That page does not exist. -- a 404, for http://branch1.laboratoriopublico.org/searches/test. That's odd, no?

@icarito
Copy link
Member

icarito commented Feb 14, 2017 via email

@icarito
Copy link
Member

icarito commented Feb 14, 2017 via email

@jywarren
Copy link
Member Author

Indeed - i see:

Search Results | 10 results
  Common-anode LED thermal flashlight casing and circuit diagram | by lmc6399group | 3 comments

for any search. I also noticed you have to be logged in to search, good to fix that too at some point.

@icarito
Copy link
Member

icarito commented Feb 17, 2017

Currently we've managed to reindex, but the tests of searches don't work as they are expected - we get the same results over an over. Currently we need to figure out how the query to the Solr engine is being built, whether it is correct and the index is wrong, or the query itself is wrong.

The route to the advanced search as is running in branch1 testing instance is at:
http://branch1.laboratoriopublico.org/searches/new

@jywarren
Copy link
Member Author

jywarren commented Feb 17, 2017 via email

@icarito
Copy link
Member

icarito commented Feb 20, 2017

Attempting an advanced search, while not logged in, produces:

Started POST "/searches" for 200.106.8.100 at 2017-02-20 07:00:20 +0000
Processing by SearchesController#create as HTML
  Parameters: {"utf8"=>"✓", "authenticity_token"=>"XXXREMOVEDXXX", "search_record"=>{"key_words"=>"test", "main_type"=>"Notes or Wiki updates", "language"=>"", "min_date"=>"", "max_date"=>""}}
Completed 500 Internal Server Error in 1.2ms

NoMethodError (undefined method `id' for nil:NilClass):
  app/controllers/searches_controller.rb:29:in `create'

@icarito
Copy link
Member

icarito commented Feb 20, 2017

I'm documenting here what I find. When logged in, logs show:

Started POST "/searches" for 200.106.8.100 at 2017-02-20 07:02:17 +0000
Processing by SearchesController#create as HTML
  Parameters: {"utf8"=>"✓", "authenticity_token"=>"1Tg3EQbaimgaC3NWYP6GxJ22D1Jhj4toZONOOnX/CoY=", "search_record"=>{"key_words"=>"test", "main_type"=>"Notes or Wiki updates", "language"=>"", "min_date"=>"", "max_date"=>""}}
Redirected to http://branch1.laboratoriopublico.org/searches/10
Completed 302 Found in 751.5ms (ActiveRecord: 225.0ms)
Started GET "/searches/10" for 200.106.8.100 at 2017-02-20 07:02:18 +0000
Processing by SearchesController#show as HTML
  Parameters: {"id"=>"10"}
  Rendered sidebar/_notes.html.erb (0.0ms)
  Rendered sidebar/_related.html.erb (21.0ms)
  Rendered searches/_form.html.erb (8.3ms)
  Rendered searches/_node_result.html.erb (226.0ms)
  Rendered searches/show.html.erb within layouts/application (262.5ms)
Read fragment views/feature_anniversary-banner 0.2ms
Read fragment views/feature_sitewide-alert 0.1ms
  Rendered layouts/_alerts.html.erb (0.8ms)
  Rendered layouts/_header.html.erb (131.1ms)
Read fragment views/feature_footer-notice 0.1ms
  Rendered layouts/_footer.html.erb (0.9ms)
Completed 200 OK in 1543.3ms (Views: 142.3ms | ActiveRecord: 779.9ms | Solr: 99.5ms)                                                                                                                                               

Going to check Solr logs now.

@icarito
Copy link
Member

icarito commented Feb 20, 2017

I searched for my name on users and Solr logged:

solr_1 | 483682436 INFO  (qtp1112280004-15) [   x:default] o.a.s.u.p.LogUpdateProcessor [default] webapp=/solr path=/update params={wt=ruby} {add=[User 448589 (1559835171559047168)]} 0 4
solr_1 | 483682648 INFO  (qtp1112280004-18) [   x:default] o.a.s.u.UpdateHandler start commit{,optimize=false,openSearcher=true,waitSearcher=true,expungeDeletes=false,softCommit=false,prepareCommit=false}
solr_1 | 483683127 INFO  (qtp1112280004-18) [   x:default] o.a.s.c.SolrCore SolrDeletionPolicy.onCommit: commits: num=2 
solr_1 |        commit{dir=NRTCachingDirectory(MMapDirectory@/opt/solr/server/solr/mycores/default/data/index lockFactory=org.apache.lucene.store.NativeFSLockFactory@4fbf90f3; maxCacheMB=48.0 maxMergeSizeMB=4.0),segFN=segments_f5,generation=545}                                                                                                                                                                 solr_1 |        commit{dir=NRTCachingDirectory(MMapDirectory@/opt/solr/server/solr/mycores/default/data/index lockFactory=org.apache.lucene.store.NativeFSLockFactory@4fbf90f3; maxCacheMB=48.0 maxMergeSizeMB=4.0),segFN=segments_f6,generation=546}                                                                                                                                                                 solr_1 | 483683127 INFO  (qtp1112280004-18) [   x:default] o.a.s.c.SolrCore newest commit generation = 546                                                                                                 solr_1 | 483683128 INFO  (qtp1112280004-18) [   x:default] o.a.s.s.SolrIndexSearcher Opening Searcher@71162bce[default] main                                                                               solr_1 | 483683130 INFO  (searcherExecutor-7-thread-1-processing-x:default) [   x:default] o.a.s.c.SolrCore QuerySenderListener sending requests to Searcher@71162bce[default] main{ExitableDirectoryReader(UninvertingDirectoryReader(Uninverting(_ou(5.3.2):c46766) Uninverting(_o1(5.3.2):C233512/53844:delGen=2) Uninverting(_ob(5.3.2):c135514/1:delGen=1) Uninverting(_oc(5.3.2):C1950) Uninverting(_oe(5.3.2):C1850) Uninverting(_og(5.3.2):C1700) Uninverting(_oi(5.3.2):C1683) Uninverting(_oj(5.3.2):C13100) Uninverting(_ok(5.3.2):C1850) Uninverting(_ol(5.3.2):C7988) Uninverting(_p4(5.3.2):C194429) Uninverting(_pe(5.3.2):c144134) Uninverting(_p0(5.3.2):C2532) Uninverting(_pd(5.3.2):C3254) Uninverting(_pf(5.3.2):C27522) Uninverting(_pg(5.3.2):C3769) Uninverting(_ph(5.3.2):C27203) Uninverting(_pi(5.3.2):C2784) Uninverting(_pj(5.3.2):C11430) Uninverting(_qo(5.3.2):C1) Uninverting(_rd(5.3.2):C1)))}                                                                                                                       solr_1 | 483683130 INFO  (qtp1112280004-18) [   x:default] o.a.s.u.UpdateHandler end_commit_flush                                                                                                          solr_1 | 483683130 INFO  (searcherExecutor-7-thread-1-processing-x:default) [   x:default] o.a.s.c.SolrCore QuerySenderListener done.                                                                      solr_1 | 483683130 INFO  (searcherExecutor-7-thread-1-processing-x:default) [   x:default] o.a.s.c.SolrCore [default] Registered new searcher Searcher@71162bce[default] main{ExitableDirectoryReader(UninvertingDirectoryReader(Uninverting(_ou(5.3.2):c46766) Uninverting(_o1(5.3.2):C233512/53844:delGen=2) Uninverting(_ob(5.3.2):c135514/1:delGen=1) Uninverting(_oc(5.3.2):C1950) Uninverting(_oe(5.3.2):C1850) Uninverting(_og(5.3.2):C1700) Uninverting(_oi(5.3.2):C1683) Uninverting(_oj(5.3.2):C13100) Uninverting(_ok(5.3.2):C1850) Uninverting(_ol(5.3.2):C7988) Uninverting(_p4(5.3.2):C194429) Uninverting(_pe(5.3.2):c144134) Uninverting(_p0(5.3.2):C2532) Uninverting(_pd(5.3.2):C3254) Uninverting(_pf(5.3.2):C27522) Uninverting(_pg(5.3.2):C3769) Uninverting(_ph(5.3.2):C27203) Uninverting(_pi(5.3.2):C2784) Uninverting(_pj(5.3.2):C11430) Uninverting(_qo(5.3.2):C1) Uninverting(_rd(5.3.2):C1)))}                                                                                                                             solr_1 | 483683131 INFO  (qtp1112280004-18) [   x:default] o.a.s.u.p.LogUpdateProcessor [default] webapp=/solr path=/update params={wt=ruby} {commit=} 0 483                                               solr_1 | 483683593 INFO  (qtp1112280004-19) [   x:default] o.a.s.c.S.Request [default] webapp=/solr path=/select params={q=*:*&facet.field=updated_month_s&start=0&fq=type:DrupalNode&fq=updated_at_s:{*+TO+"2017\-02\-20\+07\:12\:22\+UTC"}&rows=10&wt=ruby&facet=true&f.updated_month_s.facet.mincount=1} hits=7583 status=0 QTime=8                                                                                solr_1 | 483683627 INFO  (qtp1112280004-22) [   x:default] o.a.s.c.S.Request [default] webapp=/solr path=/select params={q=*:*&facet.field=updated_month_s&start=0&fq=type:DrupalNode&fq=updated_at_s:{*+TO+"2017\-02\-20\+07\:12\:22\+UTC"}&rows=10&wt=ruby&facet=true&f.updated_month_s.facet.mincount=1} hits=7583 status=0 QTime=18                                                                               solr_1 | 483683856 INFO  (qtp1112280004-17) [   x:default] o.a.s.u.p.LogUpdateProcessor [default] webapp=/solr path=/update params={wt=ruby} {add=[User 448589 (1559835173051170816)]} 0 1                 solr_1 | 483683970 INFO  (qtp1112280004-15) [   x:default] o.a.s.u.UpdateHandler start commit{,optimize=false,openSearcher=true,waitSearcher=true,expungeDeletes=false,softCommit=false,prepareCommit=false}                                                                                                                                                                                                          solr_1 | 483684463 INFO  (qtp1112280004-15) [   x:default] o.a.s.c.SolrCore SolrDeletionPolicy.onCommit: commits: num=2                                                                                    solr_1 |        commit{dir=NRTCachingDirectory(MMapDirectory@/opt/solr/server/solr/mycores/default/data/index lockFactory=org.apache.lucene.store.NativeFSLockFactory@4fbf90f3; maxCacheMB=48.0 maxMergeSizeMB=4.0),segFN=segments_f6,generation=546}                                                                                                                                                                 solr_1 |        commit{dir=NRTCachingDirectory(MMapDirectory@/opt/solr/server/solr/mycores/default/data/index lockFactory=org.apache.lucene.store.NativeFSLockFactory@4fbf90f3; maxCacheMB=48.0 maxMergeSizeMB=4.0),segFN=segments_f7,generation=547}                                                                                                                                                                 solr_1 | 483684463 INFO  (qtp1112280004-15) [   x:default] o.a.s.c.SolrCore newest commit generation = 547                                                                                                 solr_1 | 483684465 INFO  (qtp1112280004-15) [   x:default] o.a.s.s.SolrIndexSearcher Opening Searcher@6aad9590[default] main                                                                               solr_1 | 483684467 INFO  (searcherExecutor-7-thread-1-processing-x:default) [   x:default] o.a.s.c.SolrCore QuerySenderListener sending requests to Searcher@6aad9590[default] main{ExitableDirectoryReader(UninvertingDirectoryReader(Uninverting(_ou(5.3.2):c46766) Uninverting(_o1(5.3.2):C233512/53844:delGen=2) Uninverting(_ob(5.3.2):c135514/1:delGen=1) Uninverting(_oc(5.3.2):C1950) Uninverting(_oe(5.3.2):C1850) Uninverting(_og(5.3.2):C1700) Uninverting(_oi(5.3.2):C1683) Uninverting(_oj(5.3.2):C13100) Uninverting(_ok(5.3.2):C1850) Uninverting(_ol(5.3.2):C7988) Uninverting(_p4(5.3.2):C194429) Uninverting(_pe(5.3.2):c144134) Uninverting(_p0(5.3.2):C2532) Uninverting(_pd(5.3.2):C3254) Uninverting(_pf(5.3.2):C27522) Uninverting(_pg(5.3.2):C3769) Uninverting(_ph(5.3.2):C27203) Uninverting(_pi(5.3.2):C2784) Uninverting(_pj(5.3.2):C11430) Uninverting(_qo(5.3.2):C1) Uninverting(_re(5.3.2):C1)))}                                                                                                                       solr_1 | 483684467 INFO  (searcherExecutor-7-thread-1-processing-x:default) [   x:default] o.a.s.c.SolrCore QuerySenderListener done.                                                                      solr_1 | 483684467 INFO  (qtp1112280004-15) [   x:default] o.a.s.u.UpdateHandler end_commit_flush                                                                                                          solr_1 | 483684467 INFO  (searcherExecutor-7-thread-1-processing-x:default) [   x:default] o.a.s.c.SolrCore [default] Registered new searcher Searcher@6aad9590[default] main{ExitableDirectoryReader(UninvertingDirectoryReader(Uninverting(_ou(5.3.2):c46766) Uninverting(_o1(5.3.2):C233512/53844:delGen=2) Uninverting(_ob(5.3.2):c135514/1:delGen=1) Uninverting(_oc(5.3.2):C1950) Uninverting(_oe(5.3.2):C1850) Uninverting(_og(5.3.2):C1700) Uninverting(_oi(5.3.2):C1683) Uninverting(_oj(5.3.2):C13100) Uninverting(_ok(5.3.2):C1850) Uninverting(_ol(5.3.2):C7988) Uninverting(_p4(5.3.2):C194429) Uninverting(_pe(5.3.2):c144134) Uninverting(_p0(5.3.2):C2532) Uninverting(_pd(5.3.2):C3254) Uninverting(_pf(5.3.2):C27522) Uninverting(_pg(5.3.2):C3769) Uninverting(_ph(5.3.2):C27203) Uninverting(_pi(5.3.2):C2784) Uninverting(_pj(5.3.2):C11430) Uninverting(_qo(5.3.2):C1) Uninverting(_re(5.3.2):C1)))}                                                                                                                             solr_1 | 483684469 INFO  (qtp1112280004-15) [   x:default] o.a.s.u.p.LogUpdateProcessor [default] webapp=/solr path=/update params={wt=ruby} {commit=} 0 499        

@icarito
Copy link
Member

icarito commented Feb 20, 2017

This was my query:

Processing by SearchesController#create as HTML                                                                                                                                                            
  Parameters: {"utf8"=>"✓", "authenticity_token"=>"1Tg3EQbaimgaC3NWYP6GxJ22D1Jhj4toZONOOnX/CoY=", "search_record"=>{"key_words"=>"Sebastian Silva", "main_type"=>"User Profiles", "language"=>"", "min_date"=>"", "max_date"=>""}}                                                                                                                                                                                    
Redirected to http://branch1.laboratoriopublico.org/searches/11        

@icarito
Copy link
Member

icarito commented Feb 23, 2017

Well the index has +800k documents, but I'm getting the same 10 results for every search.

@icarito
Copy link
Member

icarito commented Feb 24, 2017

This may be related to the issues that were fixed in #992

If redoubled my efforts and went hunting over the rails console.
It appears to me that there is something wrong with the create method at https://github.com/publiclab/plots2/blob/master/app/controllers/searches_controller.rb#L19

It is creating a search record, but is not saving the key_words:

I tried searching over the advanced search form and then went to examine the resulting SearchRecord.

s = SearchRecord.find id=21
  SearchRecord Load (0.6ms)  SELECT `searches`.* FROM `searches` WHERE `searches`.`id` = 21 LIMIT 1
=> #<SearchRecord id: 21, key_words: nil, title: "Advanced search", user_id: "448589", created_at: "2017-02-24 07:08:49", updated_at: "2017-02-24 07:08:49", main_type: nil, note_type: nil, created_by: nil, max_date: nil, language: nil, min_date: nil>

@jywarren
Copy link
Member Author

Indeed it gets sent from the form:

Processing by SearchesController#create as HTML
  Parameters: {"utf8"=>"✓", "authenticity_token"=>"xxx", "search_record"=>{"key_words"=>"test", "main_type"=>"Notes or Wiki u
pdates", "language"=>"", "min_date"=>"", "max_date"=>""}}

@jywarren
Copy link
Member Author

jywarren commented Feb 24, 2017

And here, doing it in the console:

2.1.2 :002 > s = SearchRecord.new({key_words: 'balloon'})
 => #<SearchRecord id: nil, key_words: "balloon", title: nil, user_id: nil, created_at: nil, updated_at: nil, main_type: nil, note_type: nil, created_by: nil, max_date: nil, language: nil, min_date: nil> 
2.1.2 :003 > s.save
   (0.5ms)  begin transaction
  SQL (51.0ms)  INSERT INTO "searches" ("created_at", "created_by", "key_words", "language", "main_type", "max_date", "min_date", "note_type", "title", "updated_at", "user_id") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)  [["created_at", Fri, 24 Feb 2017 16:09:08 UTC +00:00], ["created_by", nil], ["key_words", "balloon"], ["language", nil], ["main_type", nil], ["max_date", nil], ["min_date", nil], ["note_type", nil], ["title", nil], ["updated_at", Fri, 24 Feb 2017 16:09:08 UTC +00:00], ["user_id", nil]]
   (19.5ms)  commit transaction
 => true 
2.1.2 :005 > SearchRecord.find 1
  SearchRecord Load (0.9ms)  SELECT "searches".* FROM "searches" WHERE "searches"."id" = ? LIMIT 1  [["id", 1]]
 => #<SearchRecord id: 1, key_words: "balloon", title: nil, user_id: nil, created_at: "2017-02-24 16:09:08", updated_at: "2017-02-24 16:09:08", main_type: nil, note_type: nil, created_by: nil, max_date: nil, language: nil, min_date: nil>

@icarito
Copy link
Member

icarito commented Feb 24, 2017

Okay, doing it manually like that in the rails console actually saves the key_words. That makes the search key_words accessible to the form when displaying the results (i.e. they are shown in the text entry). BUT, it doesn't seem to affect the search results.

@jywarren
Copy link
Member Author

Disabled a faulty test

@jywarren
Copy link
Member Author

jywarren commented Mar 1, 2017

Adding a test to ensure that results of DrupalNode.search do with different fulltext strings don't return the same result, also copying said unit tests into the solr test suite to be run on the real solr test system as well as the stubbed (fake) solr service in normal tests. We'll see how it goes.

@icarito
Copy link
Member

icarito commented Mar 1, 2017

It reindexed but we're not running tests on this instance. I'll enable them on the jenkins config http://jenkins.laboratoriopublico.org/job/Plots-Solr/19/console

@icarito
Copy link
Member

icarito commented Mar 1, 2017

I've changed the configuration and built manually http://jenkins.laboratoriopublico.org/job/Plots-Solr/20/console - let's see.

@icarito
Copy link
Member

icarito commented Apr 21, 2017

Hi,
Earlier the indexing was interrupted by the commits that triggered Jenkins to rebuild fix_solr branch. I've restarted reindexing and will verify numdocs and search responses. Excited to finish this!

@icarito
Copy link
Member

icarito commented Apr 21, 2017

icarito@tycho:/srv/plots_branch1/plots2$ RAILS_ENV=production docker-compose run web rake sunspot:reindex DISABLE_SOLR=true
[###################################################################################] [871891/871891] [100.00%] [32:00] [00:00] [   453.93/s]
icarito@tycho:/srv/plots_branch1/plots2$

This took 32 minutes and produced Numdocs = 0 in Solr Dashboard.
While we review what might be happening, I've launched the reindex without DISABLE_SOLR=true and it expects to take about a day to reindex.

@jywarren
Copy link
Member Author

Hmm, so that test plausibly failed because there were no results -- nothing was indexed? I pushed another change just to give us a look at what's in the response, rather than letting the JSON parsing error out (which yields less helpful info).

I think it's possible that since there are no results, lots of code isn't used (since some tests rely on getting responses). But I'm not sure about that. I'm also trying to get the line-by-line Coveralls analysis working by tweaking the Coveralls web UI settings, as mentioned in the comments on this post: https://coveralls.zendesk.com/hc/en-us/articles/201342479-Quick-help-For-Common-Problems

@jywarren
Copy link
Member Author

Whoa okay there it is!

Compare failing node.rb from last commit: https://coveralls.io/builds/11195716/source?filename=..%2Fmodels%2Fnode.rb

To passing from current master branch: https://coveralls.io/builds/11195716/source?filename=..%2Fmodels%2Fnode.rb

Oh I see -- it passed because coveralls isn't aware of multiple branches. So it's just saying its the same vs the last run on this branch.

@icarito
Copy link
Member

icarito commented Apr 23, 2017

Okay, the Jenkins was unable to reindex because Solr is disabled in config sunspot.yml.
This wouldn't fail in staging / master, because the Jenkins build config doesn't attempt to reindex there.

Great that the coverage mystery and the reindexing issues are uncovered!

@icarito
Copy link
Member

icarito commented Apr 23, 2017

But the fact that it didn't reindex or that it has Solr disabled, didnt affect its ability to launch: http://branch1.laboratoriopublico.org/ is up and working with Solr disabled, as desired.

@icarito
Copy link
Member

icarito commented Apr 23, 2017

I've gone ahead and changed sunspot.yml directly in branch1 at tycho, and reindexing with DISABLE_SOLR=true now.

@icarito
Copy link
Member

icarito commented Apr 23, 2017

$ RAILS_ENV=production docker-compose run web rake DISABLE_SOLR=true sunspot:reindex                   
[####################################################################################] [871891/871891] [100.00%] [31:38] [00:00] [   459.19/s]

image
I will issue reindex without DISABLE_SOLR and let it run.

@jywarren
Copy link
Member Author

jywarren commented Apr 23, 2017

OK, great -- the only reason I'm still waiting on this is to see why exactly coverage dropped -- i'm manually comparing the two line-by-line coveralls analyses of node.rb. Then we'll merge and let's just remember that the solr-specific tests may be failing but it's offline so that's OK...

Note that these lines are no longer covered, for some reason:

(Next few lines revised)

I also note that the whole thing runs in 9 minutes, with 163 unit tests (3 new ones): https://travis-ci.org/publiclab/plots2/builds/224713401

...not the more typical 12 minutes of recent master branch runs, which actually have fewer unit tests -- 160 unit tests: https://travis-ci.org/publiclab/plots2/builds/224893593

Looking into this more...

@icarito
Copy link
Member

icarito commented Apr 24, 2017

Allright, after 25 hours of reindexing, the indexer has all the info it seems. We will need to figure out how we can reindex in less time than that!
image
After restarting the app (it originally started on build, pointing to local solr instead of pad.publiclab.org - I switched the sunspot.yml in place).
image
So the only difference between this branch and what we have running in http://branch1.publiclab.org/ is the contents of config/sunspot.yml.
Yay close to merging!

@icarito
Copy link
Member

icarito commented Apr 24, 2017

$ RAILS_ENV=production docker-compose run web rake sunspot:reindex                                     
[#################################################################################] [871891/871891] [100.00%] [25:38:05] [00:00] [     9.45/s]

@jywarren
Copy link
Member Author

OK - well, do you think the Solr-specific test that was failing (due to a null result) would pass now? Would re-triggering this Travis check restart/reset the indexing, though?

@icarito
Copy link
Member

icarito commented Apr 24, 2017

Yes actually I think the tests should pass. Nothing is retained in Travis, if it has a Solr engine at db creation / setup time and the data is there, it should respond with results, AFAICT.
Except, sunspot.yml lists disabled: true which will make the tests fail.

@jywarren
Copy link
Member Author

Ah, yes -- so perhaps disabled: true causes Node.search to return null... this is so complicated!!!

So now we're back where we were, which was just figuring out the coverage drop before merging this.

@icarito icarito force-pushed the fix_solr branch 4 times, most recently from 795c57d to 315fe76 Compare April 25, 2017 16:05
@icarito
Copy link
Member

icarito commented Apr 25, 2017

Finally. I expect pushing this to master should not break staging instance.

@jywarren
Copy link
Member Author

Merging this now.

Next checklist should be:

Then, the rest of this:

@jywarren jywarren merged commit 7958df9 into master Apr 27, 2017
@jywarren
Copy link
Member Author

OK, remaining checklist moved to #1386

@jywarren jywarren mentioned this pull request Oct 5, 2017
3 tasks
@emilyashley emilyashley deleted the fix_solr branch January 15, 2020 21:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug the issue is regarding one of our programs which faces problems when a certain task is executed enhancement explains that the issue is to improve upon one of our existing features help wanted requires help by anyone willing to contribute
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants