Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bugfix] allows bulk inserts on aliases #1286

Merged
merged 2 commits into from Apr 17, 2019
Merged

[bugfix] allows bulk inserts on aliases #1286

merged 2 commits into from Apr 17, 2019

Conversation

benoitvidis
Copy link
Contributor

What does this PR do ?

This PR fixes the case where a bulk operation would fail on an elasticsearch index alias.

How should this be manually tested?

#!/bin/bash
  
set -x
  
es_container=kuz_elasticsearch_1
  
es=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' "$es_container"):9200
kuzzle="localhost:7512"
  
curl -XPOST $kuzzle/index/_create
curl -XPUT $kuzzle/index/collection
  
curl -d '{"actions": {"add": {"index": "index", "alias": "alias"}}}' $es/_aliases
  
curl -H "Content-type: application/json" -d '{
    "bulkData": [
      {"index": {"_type": "collection", "_index": "alias"}},
      {"foo": "bar"}
    ]
}' $kuzzle/_bulk

@codecov-io
Copy link

codecov-io commented Apr 10, 2019

Codecov Report

Merging #1286 into 1-dev will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##            1-dev    #1286      +/-   ##
==========================================
+ Coverage   93.77%   93.78%   +<.01%     
==========================================
  Files          98       98              
  Lines        6800     6804       +4     
==========================================
+ Hits         6377     6381       +4     
  Misses        423      423
Impacted Files Coverage Δ
lib/services/elasticsearch.js 93.41% <100%> (+0.05%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d3c0d8e...a732534. Read the comment docs.

@scottinet scottinet merged commit a95a819 into 1-dev Apr 17, 2019
@scottinet scottinet deleted the bugfix/bulk-alias branch April 17, 2019 08:21
@stafyniaksacha
Copy link
Contributor

There is no way to create es indexes through kuzzle yet, no ?

@scottinet
Copy link
Contributor

Of course there is: https://docs.kuzzle.io/api/1/controller-index/create/

@stafyniaksacha
Copy link
Contributor

Of course there is: https://docs.kuzzle.io/api/1/controller-index/create/

I mean, indexes aliases

@scottinet
Copy link
Contributor

Ah, no. I don't think there will ever be a standard API way to create aliases, because this is specific to Elasticsearch.

But we do have some leads about how to standardize database services, with some kind of abstraction layer above it (e.g. using Koncorde's DSL as a primary way to access data), and maybe let the ES service add some custom controllers on top of the standard API.
This would allow changing the storage solution, while still keeping what makes ES specific and powerful.

@kuzzle kuzzle mentioned this pull request Apr 29, 2019
Aschen pushed a commit that referenced this pull request Apr 29, 2019
# [1.7.3](https://github.com/kuzzleio/kuzzle/releases/tag/1.7.3) (2019-04-29)


#### Bug fixes

- [ [#1288](#1288) ] [bulk] fix an error when trying a non-partial bulk update   ([scottinet](https://github.com/scottinet))
- [ [#1286](#1286) ] [bugfix] allows bulk inserts on aliases   ([benoitvidis](https://github.com/benoitvidis))
- [ [#1282](#1282) ] [bugfix] scan keys on redis cluster   ([benoitvidis](https://github.com/benoitvidis))
- [ [#1279](#1279) ] Users must be authenticated to use auth:logout   ([scottinet](https://github.com/scottinet))

#### Enhancements

- [ [#1292](#1292) ] KZL 1032 - Throw an error when the realtime controller is invoked by plugin developers   ([benoitvidis](https://github.com/benoitvidis))
- [ [#1257](#1257) ] Add ability to define mapping policy for new fields   ([Aschen](https://github.com/Aschen))
- [ [#1291](#1291) ] [Kuzzle CLI] Fix --help on subcommands   ([Yoann-Abbes](https://github.com/Yoann-Abbes))
- [ [#1289](#1289) ] [WebSocket] Handle ping/pong packets   ([scottinet](https://github.com/scottinet))
- [ [#1273](#1273) ] Fix incomplete access logs   ([scottinet](https://github.com/scottinet))
---
@Aschen Aschen mentioned this pull request Jun 14, 2019
Aschen added a commit that referenced this pull request Jun 14, 2019
Release 1.8.0

Bug fixes

    [ #1311 ] Fix promise leaks (scottinet)
    [ #1298 ] Fix disabled protocol initialization (Aschen)
    [ #1297 ] Fix timeouts on plugin action returing the request (benoitvidis)
    [ #1288 ] Fix an error when trying a non-partial bulk update (scottinet)
    [ #1286 ] Allows bulk inserts on aliases (benoitvidis)
    [ #1282 ] Scan keys on redis cluster (benoitvidis)
    [ #1279 ] Users must be authenticated to use auth:logout (scottinet)

New features

    [ #1315 ] Add the new Vault module to handle encrypted application secrets (Aschen)
    [ #1302 ] Add write and mWrite (Aschen)
    [ #1305 ] Add pipes & hooks wildcard event (thomasarbona)

Enhancements

    [ #1318 ] Add a maximum ttl to auth:login (benoitvidis)
    [ #1301 ] Upgrade the WebSocket libraries (scottinet)
    [ #1308 ] Events triggering refactor (scottinet)
    [ #1300 ] Collection specifications methods cloisoned to a collection (thomasarbona)
    [ #1295 ] Improve validation error messages (benoitvidis)
    [ #1292 ] Throw an error when the realtime controller is invoked by plugin developers (benoitvidis)
    [ #1257 ] Add ability to define mapping policy for new fields (Aschen)
    [ #1291 ] Fix --help on subcommands (Yoann-Abbes)
    [ #1289 ] Handle ping/pong packets (scottinet)
    [ #1273 ] Fix incomplete access logs (scottinet)

Others

    [ #1317 ] Add ps dependency to plugin-dev Docker image for pm2 (benoitvidis)
    [ #1312 ] Check that .kuzzlerc.sample is well-formed (scottinet)
    [ #1299 ] Add Kuzzle Nightly & Redis 3 and 4 test (alexandrebouthinon)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants