Issues

#1805516: Basic upgrade path for 6.x-1.x to 6.x-3.x
#1548064: Upgrade drupalorg to support 6.x-3.x version of Apachesolr (Prep for D7 d.o)
#1549374: Upgrade drupalorg_crosssite to support 6.x-3.x version of Apachesolr (Prep for D7 d.o)
#1792104: Handle redirecting /search/apachesolr_search to /search/site
#1684952: Make drupalorg_search compatible with apachesolr-6.x-3.x
#1549496: Upgrade project to support 6.x-3.x version of Apachesolr (prep for d.o. upgrade to D7)
#1549636: Drupalorg w/ apachesolr 6.x-3.x: Suppress search box in body on search
#1804962: Restore "or filter by…" meta facet block
#1804966: Restore "Sort by:" on search pages
#1808072: Backport D7-specific render array elements
Make sure site runs ok with solr off for downtime.

Good info to know

  1. What are the use cases for ApacheSolr search on drupal.org?
  2. #1700572: Manually test all existing ApacheSolr functionality in D6 to determine what, if anything, is still broken

Process

  • Clean up and commit code to:
    • drupalorg_crossite's 1549374-support-new-apachesolr branch
    • drupalorg's 1548064-support-new-apachesolr branch
  • Deploy these on dev, along with other module upgrades (see deployment instructions)
  • Re-index & test
  • Deploy these on staging.devdrupal.org
  • Re-index & test
  • Deploy live, using staging's index to minimize downtime
  • Re-index

Deployment

  • Copy /var/lib/solr/do-staging from stagingsolr to live (4.3G)
  • Bring site down
  • Make backups
  • Enable and run http://localhost:8080/view/D.o/job/deploy_drupal.org/
  • Add to settings.local.php
    • $conf['apachesolr_environments']['solr']['url'] = '<strong>http://link/to/the/solr/index</strong>';
  • Check multisite capable
  • drush solr-index
  • to index recent content

  • Set biases to match http://drupal.org/node/1793968#comment-6621366
  • Set Facet API Meta type block title to "or filter by…" and enable on search/* pages
  • drush solr-mark-all
  • drush solr-index

groups.drupal.org

Noted differences between current gdo and updated version running apachesolr 6.x-3.x

Related gdo issues

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

drumm’s picture

The tentative schedule is test this week, and deploy live early next week.

drumm’s picture

Fresh dev sites for solr-drupal.redesign.devdrupal.org and solr-groups.redesign.devdrupal.org are now building, they will take about an hour.

Senpai’s picture

Issue tags: +solr, +drupal.org D7
drumm’s picture

drumm’s picture

Issue summary: View changes

Add another missing issue.

drumm’s picture

Issue summary: View changes

Found another issue

pwolanin’s picture

Title: Deploy Solr 3.x » Deploy Apache Solr Search Integration 6.x-3.x

title fix.

drumm’s picture

The current status is that the dev sites are still fresh, they need their codebases updated and need to be pointed at a blank core.

nnewton’s picture

nnewton’s picture

Issue summary: View changes

Clarify staging.

drumm’s picture

updatedb is kinda rocky:

Executing apachesolr_update_6301                                                                                                                                                                           [success]
Table &#039;solr_drupal.apachesolr_index_entities&#039; doesn&#039;t exist                                                                                                                                 [warning]
query: /* 127.0.0.1 home */ ALTER TABLE apachesolr_index_entities DROP INDEX changed database.mysql.inc:172
Table &#039;solr_drupal.apachesolr_index_entities&#039; doesn&#039;t exist                                                                                                                                 [warning]
query: /* 127.0.0.1 home */ ALTER TABLE apachesolr_index_entities ADD INDEX bundle_changed (bundle, changed) database.mysql.inc:172
Table &#039;solr_drupal.apachesolr_index_entities_node&#039; doesn&#039;t exist                                                                                                                            [warning]
query: /* 127.0.0.1 home */ ALTER TABLE apachesolr_index_entities_node DROP INDEX changed database.mysql.inc:172
Table &#039;solr_drupal.apachesolr_index_entities_node&#039; doesn&#039;t exist                                                                                                                            [warning]
query: /* 127.0.0.1 home */ ALTER TABLE apachesolr_index_entities_node ADD INDEX bundle_changed (bundle, changed) database.mysql.inc:172
ALTER TABLE {apachesolr_index_entities} DROP INDEX changed                                                                                                                                                 [error]
ALTER TABLE {apachesolr_index_entities} ADD INDEX bundle_changed (bundle, changed)                                                                                                                         [error]
ALTER TABLE {apachesolr_index_entities_node} DROP INDEX changed                                                                                                                                            [error]
ALTER TABLE {apachesolr_index_entities_node} ADD INDEX bundle_changed (bundle, changed)                                                                                                                    [error]
Executing apachesolr_search_update_7006                                                                                                                                                                    [success]
Invalid argument supplied for foreach() apachesolr_search.install:188                                                                                                                                      [warning]

We can either ignore these errors, and/or patch apachesolr to be more forgiving. Or maybe we need to do a complete uninstall of the previous version.

Executing drupalorg_search_update_6301                                                                                                                                                                     [success]
Table &#039;cache_apachesolr&#039; already exists                                                                                                                                                          [warning]
query: /* 127.0.0.1 home */ CREATE TABLE cache_apachesolr (
`cid` VARCHAR(255) NOT NULL DEFAULT &#039;&#039;,
`data` LONGBLOB DEFAULT NULL,
`expire` INT NOT NULL DEFAULT 0,
`created` INT NOT NULL DEFAULT 0,
`headers` TEXT DEFAULT NULL,
`serialized` SMALLINT NOT NULL DEFAULT 0,
PRIMARY KEY (cid),
INDEX expire (expire)
) /*!40100 DEFAULT CHARACTER SET utf8 */ database.mysql.inc:172

This is our custom code, we need to fix it.

drumm’s picture

Issue summary: View changes

More deployment details.

drumm’s picture

Issue summary: View changes

Quick todo

drumm’s picture

Issue summary: View changes

another todo

drumm’s picture

I updated the code on http://solr-drupal.redesign.devdrupal.org/ and configured solr. Running drush solr-mark-all, then solr-index says 114241 items successfully processed. 0 documents successfully sent to Solr.

Next step is figuring out why it is not sending documents.

drumm’s picture

Issue summary: View changes

another step

drumm’s picture

Issue summary: View changes

new dependencu

drumm’s picture

For staging - the new core is named 'do-staging' and will become active when jetty is restarted.

drumm’s picture

Issue summary: View changes

More issues

drumm’s picture

Issue summary: View changes

Filter by block config

drumm’s picture

Issue summary: View changes

more config

drumm’s picture

The staging core is ready to go when staging is.

I found another deployment step, updating project_solr, and added it to the issue summary. The dev site is working on reindexing projects. The is still uncommitted code in #1549496: Upgrade project to support 6.x-3.x version of Apachesolr (prep for d.o. upgrade to D7). I requested maintainership to do the commits, #1805376: Maintainership request for drumm.

drumm’s picture

Issue summary: View changes

Found another dependency

Nick_vh’s picture

Currently we need a new release of apachesolr-6.x-3.x so we can deploy that to drupal.org

Nick_vh’s picture

Issue summary: View changes

Adding solr Basic upgrade path for 6.x-1.x to 6.x-3.x

Nick_vh’s picture

We also need to figure out which content types we want to index (instead of exclude)

Nick_vh’s picture

Issue summary: View changes

modifying the intro

Nick_vh’s picture

Issue summary: View changes

Updating the conf for the solr index url

Nick_vh’s picture

Issue summary: View changes

Updated issue summary.

drumm’s picture

Issue summary: View changes

Update apachesolr version

drumm’s picture

Issue summary: View changes

Add version numbers

drumm’s picture

Issue summary: View changes

We already have cron limit in settings.php

Nick_vh’s picture

Issue summary: View changes

Updated issue summary.

Senpai’s picture

Assigned: Unassigned » drumm
Category: feature » task
Priority: Major » Critical

This one is @drumm's baby. Also, elevating to critical status.

Senpai’s picture

Issue summary: View changes

yet another issue

drumm’s picture

Issue summary: View changes

More issues

drumm’s picture

Issue summary: View changes

More specific versions.

drumm’s picture

Issue summary: View changes

Can't forget the blue cheese.

drumm’s picture

FileSize
2.93 KB

Attached is a patch needed for bluecheese on deployment. I'm moving bluecheese_preprocess_search_result() into drupalorg_search.

drumm’s picture

Issue summary: View changes

fixed that

drumm’s picture

Correction, moved into drupalorg_crosssite so groups gets it too.

drumm’s picture

Issue summary: View changes

bluecheese patch

drumm’s picture

I've been looking into restoring the blocks on pages like http://drupal.org/project/modules. On 1.x, these blocks are made by drupalorg_order_facet.

drupalorg_order_facet in general hasn't been working well. drupalorg_order_facet_apachesolr_facets() had been throwing errors before I committed http://drupalcode.org/project/drupalorg.git/commitdiff/35be32c34d41f48ae... and http://drupalcode.org/project/drupalorg.git/commitdiff/5506830ceeea7e380.... Currently, inside drupalorg_order_facet_block(), both $enabled_facets and $facets are empty arrays. I was able to fill $enabled_facets with

-      $enabled_facets = facetapi_get_enabled_facets($env_id);
+      $enabled_facets = facetapi_get_enabled_facets('apachesolr@' . $env_id);

If this was working on 6.x-3.x, I'm thinking it could not have used drupalorg_order_facet module. facetapi itself only provides facets for drilling down into search results, not search results from a facet. Are we missing another module? How should this be working?

drumm’s picture

I went ahead and rewrote drupalorg_order_facet for #17. It has a lot less flexibility, and is a lot more simple. Adding new sorted result blocks requires editing the $blocks array and could be made more generic if someone else has a use for it.
http://drupalcode.org/project/drupalorg.git/commitdiff/dd1e628?hp=90d81c...

I also fixed up project_solr's category search. A value key was mismatched.
http://drupalcode.org/project/project_solr.git/commitdiff/97c1c22?hp=15b...

http://solr-drupal.redesign.devdrupal.org/project/themes and http://solr-drupal.redesign.devdrupal.org/project/modules seem good now.

Anonymous’s picture

@drumm - Awesome work. I adapted some of the project_solr code for use in drupalorg_pbs. One thing I noticed that doesn't look right to me in project_solr.pages.inc at line 146:

// Show results if any
    if ($total > 0) {
      foreach ($response->response->docs as $doc) {
        $doc->created = strtotime($doc->created); // The record I am getting has $doc->ds_created, not $doc->created
        $doc->changed = strtotime($doc->changed); // Same thing here. Actually neither of these are used in the project_solr_render_search_result function. Should they just be removed?
        $output .= project_solr_render_search_result($doc);
      }
    }
    else {
      $output .= t('No projects found in this category.');
    }

Also, does the http://solr-drupal.redesign.devdrupal.org site have the full node table? I am not able to call node_load on the results I get back like you do, and I suspect it may be because http://wildkatana-drupal.redesign.devdrupal.org/ might not have the full node table. Just wanted to ask here, don't want to hijack the issue.

Anonymous’s picture

Issue summary: View changes

variable will be set in drupalorg_search.install.

drumm’s picture

Those seem unused, so I removed them, http://drupalcode.org/project/project_solr.git/commitdiff/10c6527?hp=990...

All dev sites have a reduced node table. Only old issues and forum posts are removed.

drumm’s picture

I'm going to go ahead with deploying this on staging for Drupal.org.

The groups deployment may lag a bit after Drupal.org. We'll have to keep the old index up for that, which is also our rollback plan.

drumm’s picture

Issue summary: View changes

Updated issue summary.

drumm’s picture

Issue summary: View changes

Handled with -dev

drumm’s picture

Issue summary: View changes

Branches merged

drumm’s picture

Issue summary: View changes

Done and done

drumm’s picture

Issue summary: View changes

Updating for staging deployment

drumm’s picture

Issue summary: View changes

Merges done.

jhedstrom’s picture

I updated the summary regarding the gdo upgrade.

drumm’s picture

For Drupal.org, we are going to try out http://drupal.org/project/apachesolr_url_switch on staging only. I have it configured with

$conf['apachesolr_url_switch_start_url'] = 'http://staging.drupal.org';
$conf['apachesolr_url_switch_end_url'] = 'http://drupal.org';

in settings.local.php.

drumm’s picture

Status: Active » Needs review

I indexed http://staging.devdrupal.org/ overnight, it took about 8 hours with 4 threads, which is good news.

I got the hostname wrong in the above comment, so we definitely can't use that index directly. Worst case is that we have to do a live reindexing, that's faster than 8 hours or even faster if we can use more threads. The production DB is nicer than staging. MySQL is the bottleneck.

I spot checked most things and have noticed something funny with meta facets, for example http://staging.devdrupal.org/search/site/unicorn?f[0]=ss_meta_type%3Afor....

Please test http://staging.devdrupal.org/ for other issues.

jhedstrom’s picture

FileSize
12.24 KB

Seeing a bit of extra text on the initial facet:

Selection_067.png

Looking into this now.

eliza411’s picture

First run of BDD tests are at http://drupal.org/node/1814498

I'm opening individual issues for the failed steps and updating tests where needed.

jhedstrom’s picture

I'm unable to replicate #25 in my local testing environment, so it's unclear why that is happening on staging.

eliza411’s picture

I opened and issue to track #25 alongside the other QA solr issues: #1815980: Solr - Extra text on the filters

drumm’s picture

After updating for #1808072: Backport D7-specific render array elements, I edited the facet and reverted it. It snapped back into place.

drumm’s picture

#25 isn't fixed. FacetAPI's ability to deal with block caching in D6 is non-existant.

drumm’s picture

Specifically, there is some D7 code commented out that might handle it.

drumm’s picture

This is the second holdup from incomplete backports in FacetAPI. Combine this with QA finding some problems and me writing the downtime announcement, http://drupal.org/node/1816068, too late to get reviewed, I think this has to be moved to early/mid-day PDT.

jhedstrom’s picture

#1792104: Handle redirecting /search/apachesolr_search to /search/site has been committed to the solr branch of drupalorg crosssite.

drumm’s picture

Next, I need to get groups indexing.

drumm’s picture

FileSize
355.72 KB

Attached is a screenshot of http://drupal.org/admin/settings/apachesolr/content-bias. We'll want to start with the same biases. I made a commit to exclude releases from indexing.

Groups: http://groups.drupal.org/admin/settings/apachesolr/content-bias doesn't bias any content types. We do exclude book pages, KDI proposals, and image node types from indexing.

drumm’s picture

Att 77% indexed, #1819312: Gracefully handle invalid UTF-8 happened. I edited the blocking node and it is continuing.

drumm’s picture

Groups indexing has started.

drumm’s picture

Indexing completed on both staging.devdrupal.org and groups.staging.devdrupal.org.

To-do:
- Revise deployment instructions to include transferring solr core and associated tracking tables from staging.
- Double check content bias settings, see #35. Automate if practical.
- Test more
- See about getting association.staging.devdrupal.org indexing
- More testing couldn't hurt

eliza411’s picture

Do you have a way to automate bias settings? If we get our test users from git6 set up on staging, we can automate a check of the bias settings as part of the the bdd tests.

Meanwhile, I re-ran the test suite: http://bddtest.drupal.org/test-output/solr.html

I'll look into the failures and create issues tomorrow, but in case you want to see them yourself you have an up-to-date copy.

Nick_vh’s picture

New releases were made :

facetapi 6.x-3.0-beta2
http://drupal.org/node/1820478

apachesolr_og 6.x-3.0 and 7.x-1.0
http://drupal.org/project/apachesolr_og

apachesolr 6.x-3.0-rc1
http://drupal.org/project/apachesolr

drumm’s picture

I merged facetapi 6.x-3.0-beta2 and apachesolr 6.x-3.0-rc1 to drupal.org and groups.drupal.org. And apachesolr_og 6.x-3.0 to groups only.

drumm’s picture

drumm’s picture

Issue summary: View changes

Updated issue summary to include latest details regarding gdo deployment.

drumm’s picture

I trimmed the deployment instructions and checked them on staging.

drumm’s picture

FileSize
248.36 KB

More settings to copy over.

drumm’s picture

Status: Needs review » Fixed

Deployed and 8% reindexed.

Nick_vh’s picture

Great work all!

drumm’s picture

Indexing live is done and took 11 hours.

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Issue summary: View changes

Update for live

Project: Drupal.org infrastructure » Drupal.org customizations
Component: Drupal.org module » Miscellaneous