Skip to content

Commit

Permalink
Less invasive way of pointing temp index batches at alias
Browse files Browse the repository at this point in the history
  • Loading branch information
rudolf committed May 31, 2023
1 parent 2cf38ce commit e40d63f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Expand Up @@ -56,7 +56,7 @@ export function buildTempIndexMap(
): Record<string, string> {
return Object.entries(indexTypesMap || {}).reduce<Record<string, string>>(
(acc, [indexAlias, types]) => {
const tempIndex = getTempIndexName(indexAlias, kibanaVersion!);
const tempIndex = getTempIndexName(indexAlias, kibanaVersion!) + '_alias';

types.forEach((type) => {
acc[type] = tempIndex;
Expand Down
Expand Up @@ -303,7 +303,7 @@ describe('createBulkIndexOperationTuple', () => {
Object {
"index": Object {
"_id": "",
"_index": ".kibana_cases_8.8.0_reindex_temp_alias",
"_index": ".kibana_cases_8.8.0_reindex_temp",
},
},
Object {
Expand Down
Expand Up @@ -228,7 +228,7 @@ export const createBulkIndexOperationTuple = (
index: {
_id: doc._id,
...(typeIndexMap[doc._source.type] && {
_index: typeIndexMap[doc._source.type] + '_alias',
_index: typeIndexMap[doc._source.type],
}),
// use optimistic concurrency control to ensure that outdated
// documents are only overwritten once with the latest version
Expand Down

0 comments on commit e40d63f

Please sign in to comment.