Elasticsearch connection string `scope` key has no effect on index names
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 68/100
Direzione di ricerca
Start with src/Exceptionless.Core/Configuration/ElasticsearchOptions.cs, especially ReadFromConfiguration and ParseConnectionString, then check src/Exceptionless.Core/Jobs/Elastic/DataMigrationJob.cs and the index configuration files named in the issue. Trace how Scope, ScopePrefix, and EnableSnapshotJobs are set for both Elasticsearch configurations. Done when the scope behavior matches the chosen expected outcome and index prefixes use consistent separators.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
ElasticsearchOptions parses a scope key from ConnectionStrings:Elasticsearch, but index names are built from ScopePrefix, which is computed from AppScope before the connection string is parsed. Setting scope= in the Elasticsearch connection string changes nothing.
Where
ElasticsearchOptions.ReadFromConfigurationsetsScope = appOptions.AppScopeandScopePrefixfrom it, then callsParseConnectionString.ParseConnectionStringoverwritesScopefrom thescopekey but never recomputesScopePrefix.- Every index uses
ScopePrefix, e.g.EventIndexand the migrations index. Nothing readsElasticsearchOptions.Scopefor the main cluster. - The only reader of
ScopeisDataMigrationJob, forElasticsearchToMigrate, where it is used as a raw prefix with no-separator (scope=prodgivesprodorganizations-v1, while the main cluster's prefix would beprod-).
Steps to reproduce
- Run with
EX_ConnectionStrings__Elasticsearch=server=http://localhost:9200;scope=testand noEX_AppScope. - List indexes: they are
events-v1-*,stacks-v1,organizations-v1, etc., without atest-prefix.
Expected
Either scope in the Elasticsearch connection string prefixes index names the same way AppScope does, or the key is not parsed at all.
Suggested fix
Set ScopePrefix at the end of ParseConnectionString (ScopePrefix = String.IsNullOrEmpty(Scope) ? "" : $"{Scope}-"), so both the main and ElasticsearchToMigrate options get it, and compute the EnableSnapshotJobs default after parsing, since it depends on ScopePrefix. In DataMigrationJob, use ElasticsearchToMigrate.ScopePrefix so both sides use the same - separator. If per-connection scoping isn't wanted, remove the scope parsing for the main connection string and keep it only for ElasticsearchToMigrate.
- Lingua principale
- C#
- Stelle
- 2.5k
- Fork
- 508
- Merge medio
- 2g 17h
- PR unite (30g)
- 40
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di exceptionless/Exceptionless
-
bug documentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
exceptionless/Exceptionless#2707 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
exceptionless/Exceptionless#2706 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
exceptionless/Exceptionless#2705 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
exceptionless/Exceptionless#2704 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 73/100
exceptionless/Exceptionless#2703 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di exceptionless/Exceptionless
Issue simili
-
bug effort:S P3
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
nightscout/nocturne#3093 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
I maintainer di solito rispondono entro 3 giorni
-
Add 'upm' tag on githubAperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100