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

Remove LocalCheckpointTracker#resetCheckpoint #34667

Merged
merged 13 commits into from
Dec 7, 2018

Conversation

dnhatn
Copy link
Member

@dnhatn dnhatn commented Oct 20, 2018

In #34474, we added a new assertion to ensure that the LocalCheckpointTracker is always consistent with Lucene index. However, we reset LocalCheckpoinTracker in testDedupByPrimaryTerm cause this assertion to be violated.

This commit removes resetCheckpoint from LocalCheckpointTracker and rewrites testDedupByPrimaryTerm without resetting the local checkpoint.

This commit removes resetCheckpoint from LocalCheckpoinTracker and
rewrites testDedupByPrimaryTerm without resetting the local checkpoint.
@dnhatn dnhatn added >non-issue v7.0.0 :Distributed Indexing/Engine Anything around managing Lucene and the Translog in an open shard. v6.5.0 labels Oct 20, 2018
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-distributed

dnhatn added a commit to dnhatn/elasticsearch that referenced this pull request Oct 20, 2018
dnhatn added a commit that referenced this pull request Oct 20, 2018
@dnhatn dnhatn requested a review from bleskes October 23, 2018 03:12
@bleskes
Copy link
Contributor

bleskes commented Oct 23, 2018

@dnhatn does that test even have value today? I think that we now rollback, we should never override a term in lucene? (actually we should never override an operation)

@dnhatn
Copy link
Member Author

dnhatn commented Oct 23, 2018

@bleskes If an operation above the local checkpoint is delivered multiple times, we will index multiple copies into Lucene (please see https://github.com/elastic/elasticsearch/blob/master/server/src/main/java/org/elasticsearch/index/engine/InternalEngine.java#L920). We can make the Engine to index once. WDYT?

@dnhatn
Copy link
Member Author

dnhatn commented Oct 23, 2018

@bleskes I renamed and added a comment for the test. It's ready for another round.

@colings86 colings86 added v6.6.0 and removed v6.5.0 labels Oct 25, 2018
kcm pushed a commit that referenced this pull request Oct 30, 2018
Copy link
Contributor

@bleskes bleskes left a comment

Choose a reason for hiding this comment

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

LGTM

int totalOps = 0;
for (Engine.Operation op : operations) {
// Engine skips deletes or indexes below the local checkpoint
if (engine.getLocalCheckpoint() < op.seqNo() || op instanceof Engine.NoOp) {
Copy link
Contributor

Choose a reason for hiding this comment

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

The fact that we process noops differently than indexing / delete ops (w.r.t localcheckpoint) sounds like a bug (different) PR)

Copy link
Member Author

Choose a reason for hiding this comment

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

sure, I will make this in a follow up.

@bleskes
Copy link
Contributor

bleskes commented Nov 8, 2018

We can make the Engine to index once. WDYT?

I think this is a good thing to do and we discussed it in the context of the following engine. I think that to fully do it we need to have soft deletes and restore the local checkpoint tracker correctly when opening the engine. Based on that, I think we need to wait until soft deletes become a default.

@bleskes
Copy link
Contributor

bleskes commented Nov 8, 2018

Based on that, I think we need to wait until soft deletes become a default.

On a second thought, I think there is value in beta testing this before. I would need to see how it looks like to make a better judgment call. That said - no rush what so ever to do this.

@dnhatn
Copy link
Member Author

dnhatn commented Dec 7, 2018

Thanks @bleskes.

@dnhatn dnhatn merged commit f2df0a5 into elastic:master Dec 7, 2018
@dnhatn dnhatn deleted the remove-reset-checkpoint branch December 7, 2018 17:22
dnhatn added a commit that referenced this pull request Dec 9, 2018
In #34474, we added a new assertion to ensure that the
LocalCheckpointTracker is always consistent with Lucene index. However,
we reset LocalCheckpoinTracker in testDedupByPrimaryTerm cause this
assertion to be violated.

This commit removes resetCheckpoint from LocalCheckpointTracker and
rewrites testDedupByPrimaryTerm without resetting the local checkpoint.

Relates #34474
jasontedor added a commit to liketic/elasticsearch that referenced this pull request Dec 9, 2018
* elastic/6.x: (37 commits)
  [HLRC] Added support for Follow Stats API (elastic#36253)
  Exposed engine must have all ops below gcp during rollback (elastic#36159)
  TEST: Always enable soft-deletes in ShardChangesTests
  Use delCount of SegmentInfos to calculate numDocs (elastic#36323)
  Add soft-deletes upgrade tests (elastic#36286)
  Remove LocalCheckpointTracker#resetCheckpoint (elastic#34667)
  Option to use endpoints starting with _security (elastic#36379)
  [CCR] Restructured QA modules (elastic#36404)
  RestClient: on retry timeout add root exception (elastic#25576)
  [HLRC] Add support for put privileges API (elastic#35679)
  HLRC: Add rollup search (elastic#36334)
  Explicitly recommend to forceMerge before freezing (elastic#36376)
  Rename internal repository actions to be internal (elastic#36377)
  Core: Remove parseDefaulting from DateFormatter (elastic#36386)
  [ML] Prevent stack overflow while copying ML jobs and datafeeds (elastic#36370)
  Docs: Fix Jackson reference (elastic#36366)
  [ILM] Fix issue where index may not yet be in 'hot' phase (elastic#35716)
  Undeprecate /_watcher endpoints (elastic#36269)
  Docs: Fix typo in bool query (elastic#36350)
  HLRC: Add delete template API (elastic#36320)
  ...
mfussenegger added a commit to crate/crate that referenced this pull request Sep 30, 2019
mfussenegger added a commit to crate/crate that referenced this pull request Sep 30, 2019
mergify bot pushed a commit to crate/crate that referenced this pull request Sep 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Distributed Indexing/Engine Anything around managing Lucene and the Translog in an open shard. >non-issue v6.6.0 v7.0.0-beta1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants