Skip to content

Revert "Use SequentialStoredFieldsLeafReader to read Lucene changes"#68586

Merged
dnhatn merged 1 commit into
elastic:masterfrom
dnhatn:revert-ccr-sequential-reader
Feb 5, 2021
Merged

Revert "Use SequentialStoredFieldsLeafReader to read Lucene changes"#68586
dnhatn merged 1 commit into
elastic:masterfrom
dnhatn:revert-ccr-sequential-reader

Conversation

@dnhatn
Copy link
Copy Markdown
Member

@dnhatn dnhatn commented Feb 5, 2021

I benchmarked an improvement in CCR and found that changes introduced in #67190 made CCR 10 times slower (1816 seconds to 26515 seconds).

"total_read_remote_exec_time_millis" : 2651518
"total_read_remote_exec_time_millis" : 1816094

With concurrent indexing and Lucene merges, documents in segments are no longer sorted by sequence numbers. And if the index sorting is specified, documents are never sorted by sequence numbers. Using a mergeInstance stored field reader will decompress the whole block, which we will not use.

I labelled this non-issue for an unreleased bug. I am also checking the other usages of mergeInstance in Elasticsearch.

@dnhatn dnhatn added >non-issue :Distributed/Engine Anything around managing Lucene and the Translog in an open shard. :Distributed/CCR Issues around the Cross Cluster State Replication features v8.0.0 v7.12.0 labels Feb 5, 2021
@dnhatn dnhatn requested review from jimczi and romseygeek February 5, 2021 14:04
@elasticmachine elasticmachine added the Team:Distributed Meta label for distributed team. label Feb 5, 2021
@elasticmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-distributed (Team:Distributed)

@dnhatn
Copy link
Copy Markdown
Member Author

dnhatn commented Feb 5, 2021

@dliappis Is it possible to have CCR in our nightly benchmark to catch such a kind of issue? Thanks!

Copy link
Copy Markdown
Contributor

@romseygeek romseygeek left a comment

Choose a reason for hiding this comment

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

Well done catching this before it was released! Do we know if it did improve things for the specific case where sequence number order was preserved, or does that basically never happen?

@dliappis
Copy link
Copy Markdown
Contributor

dliappis commented Feb 5, 2021

@dliappis Is it possible to have CCR in our nightly benchmark to catch such a kind of issue? Thanks!

@dnhatn as discussed offline, currently the bare metal infrastructure isn't ready to support such experiments that by definition require different regions, so we'll need to rely on the self service workflow for a bit I am afraid.

@dnhatn
Copy link
Copy Markdown
Member Author

dnhatn commented Feb 5, 2021

Thanks @romseygeek + @dliappis.

@dnhatn
Copy link
Copy Markdown
Member Author

dnhatn commented Feb 5, 2021

Do we know if it did improve things for the specific case where sequence number order was preserved, or does that basically never happen?

I will look into this.

@dnhatn dnhatn merged commit c3cc521 into elastic:master Feb 5, 2021
@dnhatn dnhatn deleted the revert-ccr-sequential-reader branch February 5, 2021 15:06
dnhatn added a commit that referenced this pull request Feb 5, 2021
…68586)

Revert "Use SequentialStoredFieldsLeafReader to read Lucene changes (#67190)" (#68586)

This reverts commit 5fe0d67.

I benchmarked an improvement in CCR and found that changes introduced in
#67190 made CCR 10 times slower (1816 seconds to 26515 seconds).

"total_read_remote_exec_time_millis" : 2651518
"total_read_remote_exec_time_millis" : 1816094

With concurrent indexing and Lucene merges, documents in segments are no
longer sorted by sequence numbers. And if the index sorting is
specified, documents are never sorted by sequence numbers. Using a
mergeInstance stored field reader will decompress the whole block, which
we will not use.

Reverts #67190
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Distributed/CCR Issues around the Cross Cluster State Replication features :Distributed/Engine Anything around managing Lucene and the Translog in an open shard. >non-issue Team:Distributed Meta label for distributed team. v7.12.0 v8.0.0-alpha1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants