Issue 1:
As-is, the repository-hdfs plugin isn't going to work at all from what i see.

I'm just plotting what I think we need to do to fix it, before releasing it:

Four plugin zip versions are created, none are really tested, none are working (except on windows). For example the -lite.zip has no hadoop jars and expects the users to drop hadoop jars in their ES_CLASSPATH. We don't allow this, this is not going to work at all.

we need to drop the -hadoop1 and -lite stuff and just one have one jar, we need to get the basics working, walk before we can run. from what i see, things aren't working at all.

documentation recommends adding configuration files and similar to the CLASSPATH or ES lib/ folder, we can't do things this way anymore! Its not going to work!

security permissions are not correct: it only adds jaas_nt. This means that this plugin is only going to work on windows NT platforms: anything else = instant security exception.

The use of HDFS should be made reliable (means hdfs2 only), since its a snapshot restore plugin. To me this means two things, fsync and atomic rename. I don't see any synchronization, and the rename it uses for committing does not look like the atomic one (rename2).

no tests are failing!

Issue 2:
Elasticsearch version: 5.0.0-alpha3

JVM version: 1.8.0_73-b02

OS version: CentOS Linux release 7.2.1511

Description of the problem including expected versus actual behavior:

I'm trying to upgrade an ES plugin from 2.3 to 5.0.0-alpha3, and a template we previously had working is now causing an issue. The template attempts to set some default analyzers for an index, but when the index is created it throws an error saying there's already an analyzer with the default name.

Here's the template I'm using:

{ "order": 0, "settings": { "index.analysis.analyzer.fairhairIndexAnalyzerv3.alias": "default", "index.analysis.analyzer.fairhairIndexAnalyzerv3.type": "fairhair-index-analyzer", "index.analysis.analyzer.fairhairTokenizingAnalyzer.type": "fairhair-tokenizing-analyzer", "index.analysis.analyzer.fairhairTokenizingAnalyzer.alias": "default_search" }, "mappings" : { //some mappings }, "template" : "document.*" }

Provide logs (if relevant):

Here's the error stack trace I get:

elasticsearch_1 | [2016-06-28 23:40:43,871][DEBUG][action.admin.indices.create] [Iridia] [document.document-20151106] failed to create elasticsearch_1 | java.lang.IllegalStateException: already registered analyzer with name: default elasticsearch_1 | at org.elasticsearch.index.analysis.AnalysisService.<init>(AnalysisService.java:109) elasticsearch_1 | at org.elasticsearch.index.analysis.AnalysisRegistry.build(AnalysisRegistry.java:161) elasticsearch_1 | at org.elasticsearch.index.IndexService.<init>(IndexService.java:138) elasticsearch_1 | at org.elasticsearch.index.IndexModule.newIndexService(IndexModule.java:328) elasticsearch_1 | at org.elasticsearch.indices.IndicesService.createIndexService(IndicesService.java:398) elasticsearch_1 | at org.elasticsearch.indices.IndicesService.createIndex(IndicesService.java:363)

I've looked at the AnalysisService class constructor, and I see it does a check for analyzers with the name "default" in the passed in analyzer mappings. I believe these conditional statements fire:

if (!analyzerProviders.containsKey("default")) { analyzerProviders.put("default", new StandardAnalyzerProvider(indexSettings, null, "default", Settings.Builder.EMPTY_SETTINGS)); } if (!analyzerProviders.containsKey("default_search")) { analyzerProviders.put("default_search", analyzerProviders.get("default")); } if (!analyzerProviders.containsKey("default_search_quoted")) { analyzerProviders.put("default_search_quoted", analyzerProviders.get("default_search")); }

So it registers the standard analyzer, but while iterating through the passed in analyzers, this check also fires:

if (analyzers.containsKey(name)) { //Grabs the name from each entry in analyzer map throw new IllegalStateException("already registered analyzer with name: " + name); }

I'm confused as to how both these conditions are firing. This check to see if the current map of analyzers already contains the key "name" was introduced in ES 5.

EDIT: I know why the illegal state exception is being thrown. The Analysis Registry automatically adds the entry: "default" => StandardAnalyzer. So from what I can tell, it's actually impossible to register your own default index analyzer, since there will always be the standard analyzer. I think the check for whether a name is already in the analyzer mappings is a bug and should be removed.