Skip to content

Commit 90bbe7d

Browse files
max-zillarobkooper
andauthored
Remove swap functionality on reindex (#140)
* Update ElasticsearchQueue.scala * Update CHANGELOG.md * add release number Co-authored-by: Rob Kooper <[email protected]>
1 parent 3660e3b commit 90bbe7d

File tree

5 files changed

+28
-12
lines changed

5 files changed

+28
-12
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/)
55
and this project adheres to [Semantic Versioning](http://semver.org/).
66

7+
8+
## 1.12.2 - 2020-11-19
9+
10+
### Changed
11+
- /api/reindex admin endpoint no longer deletes and swaps a temporary index, but reindexes in-place.
12+
713
## 1.12.1 - 2020-11-05
814

915
### Fixed

app/services/mongodb/ElasticsearchQueue.scala

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -71,19 +71,29 @@ class ElasticsearchQueue @Inject() (
7171
}
7272

7373
def _indexAll() = {
74+
val swap = false
75+
7476
// Add all individual entries to the queue and delete this action
7577
current.plugin[ElasticsearchPlugin].foreach(p => {
76-
val idx = p.nameOfIndex + "_reindex_temp_swap"
77-
Logger.debug("Reindexing database into temporary reindex file: "+idx)
78-
p.createIndex(idx)
78+
if (swap) {
79+
val idx = p.nameOfIndex + "_reindex_temp_swap"
80+
Logger.debug("Reindexing database into temporary reindex file: "+idx)
81+
p.createIndex(idx)
7982

80-
// queue everything for each resource type
81-
collections.indexAll(Some(idx))
82-
datasets.indexAll(Some(idx))
83-
files.indexAll(Some(idx))
83+
// queue everything for each resource type
84+
collections.indexAll(Some(idx))
85+
datasets.indexAll(Some(idx))
86+
files.indexAll(Some(idx))
8487

85-
// queue action to swap index once we're done reindexing
86-
p.queue.queue("index_swap")
88+
// queue action to swap index once we're done reindexing
89+
p.queue.queue("index_swap")
90+
} else {
91+
// TODO: This does not delete the index first! It will need to do so in some cases!
92+
p.createIndex()
93+
collections.indexAll()
94+
datasets.indexAll()
95+
files.indexAll()
96+
}
8797
})
8898
}
8999

doc/src/sphinx/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
author = 'Luigi Marini'
2323

2424
# The full version, including alpha/beta/rc tags
25-
release = '1.12.1'
25+
release = '1.12.2'
2626

2727

2828
# -- General configuration ---------------------------------------------------

project/Build.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import NativePackagerKeys._
1313
object ApplicationBuild extends Build {
1414

1515
val appName = "clowder"
16-
val version = "1.12.1"
16+
val version = "1.12.2"
1717
val jvm = "1.7"
1818

1919
def appVersion: String = {

public/swagger.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ info:
99
Clowder is a customizable and scalable data management system to support any
1010
data format and multiple research domains. It is under active development
1111
and deployed for a variety of research projects.
12-
version: 1.12.1
12+
version: 1.12.2
1313
termsOfService: https://clowder.ncsa.illinois.edu/clowder/tos
1414
contact:
1515
name: Clowder

0 commit comments

Comments
 (0)