function getListOfPossibleCores should allow the ".default" solr cores as well.
like 'WXYZ-12345.dev.default'.

CommentFileSizeAuthor
#34 2871721-for-2x-branch-34.patch5.53 KBbkosborne
#31 2871721-31.patch6.22 KBjaperry
#29 acquia_connector-2871721-29.patch1.64 KBVishnuTRZ
#28 acquia_connector-2871721-27.patch1.64 KBVishnuTRZ
#26 acquia_connector-2871721-26.patch5.8 KBVishnuTRZ
#25 acquia_connector-2871721-25.patch5.78 KBlcatlett
#24 acquia_connector-2871721-24.patch6.86 KBlcatlett
#20 acquia_connector-2871721-20.patch6.41 KBjanusman
#19 acquia_connector-2871721-18.patch1.64 KBjanusman
#16 DeepinScreenshot_select-area_20190124010405.png59.04 KBweynhamz
#14 acquia_connector-2871721-14.patch1.2 KBweynhamz
#13 acquia_connector-2871721-13.patch1.63 KBDane Powell
#12 acquia_connector-2871721-12.patch1.05 KBDane Powell
#9 2871721-9.patch715 bytesjanusman
#5 2871721-5.patch810 bytesvaibhavjain
#4 2871721-4.patch0 bytesvaibhavjain
#2 2871721-2.patch889 bytesvaibhavjain
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

vaibhavjain created an issue. See original summary.

vaibhavjain’s picture

Adding the patch here.

vaibhavjain’s picture

Status: Active » Needs review
vaibhavjain’s picture

Adding updated patch. Moved the code in if condition.

vaibhavjain’s picture

The earlier patch was bad. Updating the patch

The last submitted patch, 4: 2871721-4.patch, failed testing.

janusman’s picture

Status: Needs review » Closed (won't fix)

I see the rationale for this... but the reality is that we want to avoid pollution at all costs, unless you are doing a override.

If we allowed ".default" by... well... default, then if you had a site at sites/default and sites/site1 ... then the "site1" site would wreck your "default" site's data.

An override (see https://docs.acquia.com/acquia-search/multiple-cores/override ) will let you use a .default-named core if you wanted to.

janusman’s picture

Status: Closed (won't fix) » Needs review

Since it looks like a few people are using this patch specifically for Site Factory sites, here is an updated version with slightly more protective logic:

  • Allow use of available .default cores
  • But only on ACSF sites, and also only on a production (01live, etc.) environment

This should avoid a non-production ACSF site from corrupting production site's data.

The remaining problem, is that a site admin needs to manage the search_api_solr.settings:site_hash value on each and every site to ensure that it is different to avoid data pollution.

janusman’s picture

Here's the patch.

janusman’s picture

Title: List of possible cores should include .default as well » For Acquia Site Factory, the list of possible cores should include .default as well

Changing issue title based on (long-ago-) discussion with original submitter.

Dane Powell’s picture

On our particular subscription, our production search core is named like WXYZ-12345 instead of WXYZ-12345.01live.default like this patch expects. Note that our dev/stage cores are named according to the expected pattern (WXYZ-12345.01dev.default). Is this unique to our subscription, or should the patch take into account this variation?

Dane Powell’s picture

Title: For Acquia Site Factory, the list of possible cores should include .default as well » Cannot connect to search cores on Acquia Site Factory
FileSize
1.05 KB

I tested #9 on our ACSF subscription and it did not work. The reason is that our production search core has no suffix (i.e. WXYZ-12345) as described in #10.

I confirmed with the search team that at least for new subscriptions, that's the correct naming convention (no environment or db suffix in ACSF prod). You might want to verify that that's the case for your own subscription as well.

It actually looks like the Search module attempts to correctly handle this case already but fails because the AH_PRODUCTION environment variable isn't defined in ACSF. So the patch is actually somewhat similar than in #9, it just has to fix that bug.

I'm also updating the issue title to reflect the nature of the bug rather than the potential solution.

Dane Powell’s picture

Whoops... #12 fails in non-ACSF prod environments because the server variable isn't defined. Additionally, in ACSF non-prod environments it might connect to a production core, which isn't good. This patch fixes those things and I've verified that it works as expected.

weynhamz’s picture

weynhamz’s picture

Patch #14 is actually duplicate of #13. Remove.

weynhamz’s picture

It looks like AH_REALM environment variable is set on all environments, can not to be used to determine if it is production.

janusman’s picture

Status: Needs review » Needs work

Tagging accordingly to previous comment.

janusman’s picture

Status: Needs work » Needs review

New patch for review:

  • Properly detects ACSF sites by checking _ENV for the realm 'enterprise-g1'
  • Detects production sites by looking at environments named '*live'

The rules are... for Site Factory sites, these core names are acceptable:

  • [id].[env].default
  • [id] (only if environment name is "[numbers]live")
janusman’s picture

janusman’s picture

New patch for review; now with tests and fixed for proper detection of the various ACSF realms.

The last submitted patch, 19: acquia_connector-2871721-18.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

weynhamz’s picture

@janusman, your second patch #20 depends on your patch #19, it can not be applied against the 8.x-1.x HEAD.

weynhamz’s picture

From comment https://www.drupal.org/project/acquia_connector/issues/2871721#comment-1...,

The remaining problem, is that a site admin needs to manage the search_api_solr.settings:site_hash value on each and every site to ensure that it is different to avoid data pollution.

Does ACSF have special handling for this hash value? What's the suggested solution, any thought?

lcatlett’s picture

As mentioned in #22, the patches in #19 and #20 are dependent on one another. Additionally, they only apply to version 1.16 of Acquia Connector rather than the latest release (1.18) or 8.x-1.x HEAD. Here is a new patch for version 1.16 of the module. Will post a patch that applies cleanly to 8.x-1.x HEAD in a separate comment.

lcatlett’s picture

As mentioned in #24, here is a patch that applies cleanly against 8.x-1.x HEAD.

VishnuTRZ’s picture

Version: 8.x-1.x-dev » 8.x-1.21
FileSize
5.8 KB

The Patch #25 causing error for the Acquia connector version 8.x-1.21. The variables name are changes which is mismatch in the custom function in the patch addACSFFallbackCores.

So the default core is not set in the $possible_core_ids.

updated the patch which now works for default core as well.

Status: Needs review » Needs work

The last submitted patch, 26: acquia_connector-2871721-26.patch, failed testing. View results

VishnuTRZ’s picture

VishnuTRZ’s picture

Added the proper comment number in the patch file.

govind.maloo’s picture

Status: Needs work » Needs review
japerry’s picture

Version: 8.x-1.21 » 8.x-1.x-dev
FileSize
6.22 KB

Rolls in the code from #29 with the tests from #25.

Status: Needs review » Needs work

The last submitted patch, 31: 2871721-31.patch, failed testing. View results

japerry’s picture

Project: Acquia Connector » Acquia Search
Version: 8.x-1.x-dev » 2.x-dev
bkosborne’s picture

Status: Needs work » Needs review
FileSize
5.53 KB

Here's a patch for the 2.x branch of the Acquia Search standalone module. The module was recently removed from the Acquia Connector 3.x branch, so anyone upgrading to that version of Acquia Connector will need use the 2.x version of the standalone module and this patch.

gaurav_manerkar’s picture

hi,

what about 3.x version of Acquia search ?

janusman’s picture

Gaurav, you can override the Solr index to use at run-time in settings.php. See the README.txt for how.

iampuma’s picture

#34 confirmed to apply to the 2.x branch of the standalone Acquia Search module. Thanks!

japerry’s picture

Status: Needs review » Closed (outdated)