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

Various cleanups for Elasticsearch test #51

Merged
merged 5 commits into from Apr 17, 2015
Merged

Conversation

dakrone
Copy link
Contributor

@dakrone dakrone commented Apr 7, 2015

This change makes four changes:

  • Adding a logging configuration

In order to actually determine the root cause of issues, more verbose logging is needed. This defaults to more verbose logging for Elasticsearch and adds the ability to change it from Jepsen in the future (instead of manually by hand).

  • Moving nuke! to before tests

Without this, Jepsen deletes all traces of itself after running, which makes debugging much more difficult (no logs and no data left).

  • Use more reasonable settings for scroll

An optional change, but I figured I would make this change anyway.

  • Wait for index to become green after creation

This is a key part of testing Elasticsearch, and clients should always do this when creating indices.


Note that I was able to reproduce the failures in elastic/elasticsearch#10426 (about half of the time) without these changes, however after the change which waits for green after index creation, I am no longer able to reproduce data loss with the create-pause test (still evaluating the other tests).

This increases the default logging to DEBUG, and sets TRACE logging for
gateway and discovery packages.
This allows someone to collect the ES logs and data *after* a test run.
Otherwise the logs and data is removed and ES is stopped, making further
debugging impossible.
After an index is created, clients should always wait for the index to
be fully created (the request returns immediately) before starting the
test.
No need for the `query_then_fetch` setting, use ten seconds instead of
one minute, and a more reasonable size of 20 rather than 2.
@dakrone
Copy link
Contributor Author

dakrone commented Apr 8, 2015

@aphyr also, how would you feel about me replacing Elastisch with vanilla clj-http? Elastisch uses clj-http internally anyway and it would reduce the number of moving parts in this test. I'm happy to submit another PR if you are interested.

(throw (RuntimeException. err))))))

:settings {"index" {"refresh_interval" "1s"}})
(catch Throwable t))
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd really prefer to know about connection errors etc that happen here; the only reason it's appropriate to noop is if the index already exists.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, I will remove this to only handle IndexAlreadyExistsException as you previously did. I do think using basic clj-http would be easier, as it'd allow you to use:

(try+
  ...
  (catch [:status 400]
    ;; ignore

Instead of catching any throwable during index creation, catch a
specific exception and ensure it was only because the index already
existed.

Additionally, this changes the hardcoded node count of 5 to
`(count (:nodes test))` so a dynamic number of nodes can be used.
@dakrone
Copy link
Contributor Author

dakrone commented Apr 17, 2015

Pushed another commit addressing your feedback, thanks for taking a look!

@aphyr
Copy link
Collaborator

aphyr commented Apr 17, 2015

Excellent, thanks @dakrone :)

aphyr added a commit that referenced this pull request Apr 17, 2015
Various cleanups for Elasticsearch test
@aphyr aphyr merged commit 8bbd973 into jepsen-io:master Apr 17, 2015
@aphyr
Copy link
Collaborator

aphyr commented Apr 28, 2015

Do these tests run for you? Elasticsearch doesn't even start on my nodes any more; times out waiting for cluster recovery.

@dakrone
Copy link
Contributor Author

dakrone commented Apr 28, 2015

@aphyr I just double-checked this and the tests are still running for me

aphyr added a commit that referenced this pull request Aug 23, 2016
Various cleanups for Elasticsearch test
def- pushed a commit to def-/jepsen that referenced this pull request May 24, 2023
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.

None yet

2 participants