Page MenuHomePhabricator

Conflicting field mappings for phabricator index when upgrading to Elasticsearch 2.0
Closed, WontfixPublic

Description

Elasticsearch 2.0 is now released, but when using the migration plugin to check if we can upgrade smoothly there is an index mapping conflict (more info about the mapping conflicts here) for the phabricator index.

The problem seems to be that the .when field is sometimes pushed as a number field containing a unix timestamp, and sometimes a string field containing a unix timestamp. So with the new strict mapping regime in ES 2.0, this will not be allowed.

Have you been seeing this yourself?

Here is the output from the migration plugin:

phabricator_index_mapping_conflict.png (118×869 px, 17 KB)

Event Timeline

kozejonaz updated the task description. (Show Details)
kozejonaz added a project: Elasticsearch.
kozejonaz added a subscriber: kozejonaz.

Uhm I tested the same last month when 2.0 was still beta then conclude that phabricator only supported 1.x.
I will follow the resolution of this.

After a closer look there seem to be quite a lot of inconsistencies for the different .when fields.

Examples:

FieldType
relationship.subs.whenstring
relationship.auth.whenstring
relationship.open.whennumber
relationship.ownr.whenconflict
relationship.unow.whenstring
relationship.proj.whenstring
relationship.clos.whennumber
relationship.repo.whenstring

As you can see, relationship.ownr.when is the one we have problems with right now.
I guess all the other ones are currently being consistently pushed as either number or string

D14370 likely fixes this, although I don't have ElasticSearch 2.0 locally and haven't tested it. I'd guess this will give you a clean bill of health:

  • Apply the patch;
  • run bin/search index --all to rebuild all indexes;
  • run the ElasticSearch tool again.

Can you let me know if that works?

Note that index --all queues stuff into the background, so you may need to wait a while before it finishes. You can use --foreground (slower) or monitor progress from /daemon/ in the web UI.

Oh, I think I misremembered and it does foreground by default. You can use --background to improve performance, and monitor from /daemon/.

I tested and i does not fix !

Well, I didn't move to elastic 2.0 but restarting elasticsearch, reindexing rerestarting and reruning plugin doesn't leave me the same error.

D14370 likely fixes this, although I don't have ElasticSearch 2.0 locally and haven't tested it. I'd guess this will give you a clean bill of health:

  • Apply the patch;
  • run bin/search index --all to rebuild all indexes;
  • run the ElasticSearch tool again.

Can you let me know if that works?

Thanks for the quick response @epriestley, we'll try it out first thing Monday just to see if we have the same results as @tycho.tatitscheff.

I tested and i does not fix !

Well, I didn't move to elastic 2.0 but restarting elasticsearch, reindexing rerestarting and reruning plugin doesn't leave me the same error.

@tycho.tatitscheff: Hey, just so I'm not misunderstanding anything. Did D14370 fix the issue for you? It seems we won't be able to test this until later this week, but if you're saying it worked than I have no reason to believe it should fail for us.

I patched with D14370 and still get an issue. I can retry but I pretty sure I did think corectly.

@epriestley/@tycho.tatitscheff: We managed to test D14370 now, and it totally fixes our problem!

Steps to test:

  1. Apply the patch
  2. Delete the phabricator index
  3. bin/search init to create the index
  4. bin/search index --all to rebuild the index

Results from the migration plugin after rebuilding the index can be seen in

phabricator_migration_success.png (736×880 px, 82 KB)
.

I don't know what other places might cause similar issues, but for our use-case this is pretty sweet. Thanks @epriestley!

@tycho.tatitscheff: I assume your problem is that you didn't delete the Phabricator index first?

Thanks for testing the patch, should be in HEAD now. Let us know if you run into anything else.

Not sure what @tycho.tatitscheff ran into.

@epriestley i think I didn't delete index first.
Just bin/search index --all.

I will apply head, delete index and phabricator template (custom one i made to improve phabricator handling french) and retest.

Thanks for testing the patch, should be in HEAD now. Let us know if you run into anything else.

Not sure what @tycho.tatitscheff ran into.

Awesome, appreciated! Will do!

ru31337 changed the task status from Resolved to Wontfix.EditedNov 9 2015, 12:54 AM
ru31337 claimed this task.
ru31337 added a subscriber: ru31337.

Index _status in 2.0 replaced _stats https://www.elastic.co/guide/en/elasticsearch/reference/2.0/indices-status.html

./bin/search init
[2015-11-09 03:51:33] EXCEPTION: (HTTPFutureHTTPResponseStatus) [HTTP/400] 
{"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"No feature for name [_status]"}],"type":"illegal_argument_exception","reason":"No feature for name [_status]"},"status":400} at [<phutil>/src/future/http/BaseHTTPFuture.php:339]
arcanist(head=master, ref.master=2db40f995337), phabricator(head=master, ref.master=a2f909f0bd0a), phutil(head=master, ref.master=610ca9eba906)
  #0 BaseHTTPFuture::parseRawHTTPResponse(string) called at [<phutil>/src/future/http/HTTPSFuture.php:415]
  #1 HTTPSFuture::isReady() called at [<phutil>/src/future/Future.php:37]
  #2 Future::resolve() called at [<phutil>/src/future/http/BaseHTTPFuture.php:279]
  #3 BaseHTTPFuture::resolvex() called at [<phabricator>/src/applications/search/engine/PhabricatorElasticSearchEngine.php:425]
  #4 PhabricatorElasticSearchEngine::executeRequest(string, array) called at [<phabricator>/src/applications/search/engine/PhabricatorElasticSearchEngine.php:286]
  #5 PhabricatorElasticSearchEngine::indexExists() called at [<phabricator>/src/applications/search/management/PhabricatorSearchManagementInitWorkflow.php:19]
  #6 PhabricatorSearchManagementInitWorkflow::execute(PhutilArgumentParser) called at [<phutil>/src/parser/argument/PhutilArgumentParser.php:406]
  #7 PhutilArgumentParser::parseWorkflowsFull(array) called at [<phutil>/src/parser/argument/PhutilArgumentParser.php:301]
  #8 PhutilArgumentParser::parseWorkflows(array) called at [<phabricator>/scripts/search/manage_search.php:21]

In phabricator issue "Elasticsearch Misconfigured"

[HTTP/400] 

{"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"No feature for name [_status]"}],"type":"illegal_argument_exception","reason":"No feature for name [_status]"},"status":400}

@ru31337, that issue isn't related to this one and isn't "wontfix". Please see Contributing Bug Reports for instructions on how to report bugs. Choosing an existing similar task, changing it to "wontfix" and dumping your issue into it won't get it fixed.