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

fixed index cache feature #137

Merged
merged 3 commits into from
Jan 29, 2016
Merged

fixed index cache feature #137

merged 3 commits into from
Jan 29, 2016

Conversation

scottinet
Copy link
Contributor

Bugfix: the index cache was handled by the elasticsearch service, called both by the server instance and its workers. Problem is: workers didn't have access to the index cache, thus leading to non-catched errors.

  • created a new indexCache core component
  • removed all index cache management from the elasticsearch service
  • replaced kuzzle.indexes with kuzzle.indexCache, using the new core component
  • the index cache is now refreshed by the write and admin controllers
  • cleanDb and prepareDb now use and maintain the index cache
  • cleanDb and prepareDb are now independant to Kuzzle to avoid adding unnecessary objects to the main context
  • added new console messages to make the Kuzzle startup sequence clearer

@codecov-io
Copy link

Current coverage is 91.79%

Merging #137 into master will increase coverage by +0.14% as of b86ba6c

@@            master    #137   diff @@
======================================
  Files           76      77     +1
  Stmts         3929    3914    -15
  Branches         0       0       
  Methods          0       0       
======================================
- Hit           3601    3593     -8
  Partial          0       0       
+ Missed         328     321     -7

Review entire Coverage Diff as of b86ba6c


Uncovered Suggestions

  1. +0.26% via ...b/services/rabbit.js#295...304
  2. +0.23% via lib/api/enable.js#14...22
  3. +0.21% via lib/api/perf.js#80...87
  4. See 7 more...

Powered by Codecov. Updated on successful CI builds.

@stafyniaksacha
Copy link
Contributor

+1!

!this.indexes._canCreate &&
_.contains(['import', 'create', 'createCollection', 'putMapping', 'createOrUpdate'], requestObject.action) &&
!doesIndexExist(requestObject, indexes)) {
_.contains(['import', 'create', 'createCollection', 'putMapping', 'createOrUpdate'], requestObject.action)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Quick note: dependencies with @dbengsch PR #138 )

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed. Good news is: merging this will be easy as in this PR, I only moved the last test to the first position, to make it clearer that it handles the case when an index or a collection doesn't exist.

@AnthonySendra
Copy link
Contributor

+1

Conflicts:
	test/api/controllers/writeController.test.js
Conflicts:
	lib/api/controllers/adminController.js
	lib/api/controllers/writeController.js
	lib/api/core/models/security/role.js
	test/api/controllers/adminController.test.js
	test/services/implementations/elasticsearch.test.js
@benoitvidis
Copy link
Contributor

+1

benoitvidis added a commit that referenced this pull request Jan 29, 2016
@benoitvidis benoitvidis merged commit e79cb90 into master Jan 29, 2016
@benoitvidis benoitvidis deleted the fixIndexCache branch January 29, 2016 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants