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

Cleanup journal throws Yajl::EncodeError: Max nesting depth of 256 exceeded #878

Open
raff-s opened this issue Feb 21, 2023 · 0 comments
Open

Comments

@raff-s
Copy link

raff-s commented Feb 21, 2023

Expected behavior

We should be able to use the journal clean functionality even when there are many indices

Actual behavior

It throws Yajl::EncodeError: Max nesting depth of 256 exceeded

Steps to reproduce the problem

Run Chewy::RakeHelper.journal_clean(except:"some_index")
You will see that you get a deeply nested ES query that looks like the following

:body=>{:query=>{:bool=>{:filter=>{:bool=>{:should=>[{:bool=>... {:term=>{:index_name=>...

Due to the logic here we'll add one level of nesting per index so when we have a large collection of indices it throws Yajl::EncodeError: Max nesting depth of 256 exceeded

Version Information

  • Chewy version - 7.2.3
  • Elasticsearch version - 7.12.0
  • Ruby version - 2.7.7
  • Rails version - 6.0.6.1
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

No branches or pull requests

1 participant