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

AssertionError "map must be empty" when call _flush/synced after deleting document #27852

Closed
floragunn opened this issue Dec 17, 2017 · 2 comments
Assignees
Labels
:Distributed/Engine Anything around managing Lucene and the Translog in an open shard.

Comments

@floragunn
Copy link

floragunn commented Dec 17, 2017

Elasticsearch version (bin/elasticsearch --version):
5.6.5 (5.6.4 works fine, so maybe related to #27534 and #27516 and #20498 )

Plugins installed: []

JVM version (java -version):
java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)

OS version (uname -a if on a Unix-like system):
Mac and Ubuntu

Description of the problem including expected versus actual behavior:
"java.lang.AssertionError: map must be empty" when it not must be thrown

Steps to reproduce:

Provide logs (if relevant):

[2017-12-17T15:24:39,706][ERROR][o.e.b.ElasticsearchUncaughtExceptionHandler] [] fatal error in thread [elasticsearch[Cj7lPWN][flush][T#3]], exiting
java.lang.AssertionError: map must be empty
	at org.elasticsearch.index.engine.LiveVersionMap.adjustMapSizeUnderLock(LiveVersionMap.java:43) ~[elasticsearch-5.6.5.jar:5.6.5]
	at org.elasticsearch.index.engine.InternalEngine.syncFlush(InternalEngine.java:997) ~[elasticsearch-5.6.5.jar:5.6.5]
	at org.elasticsearch.index.shard.IndexShard.syncFlush(IndexShard.java:757) ~[elasticsearch-5.6.5.jar:5.6.5]
	at org.elasticsearch.indices.flush.SyncedFlushService.performSyncedFlush(SyncedFlushService.java:423) ~[elasticsearch-5.6.5.jar:5.6.5]
	at org.elasticsearch.indices.flush.SyncedFlushService.access$1100(SyncedFlushService.java:70) ~[elasticsearch-5.6.5.jar:5.6.5]
	at org.elasticsearch.indices.flush.SyncedFlushService$SyncedFlushTransportHandler.messageReceived(SyncedFlushService.java:704) ~[elasticsearch-5.6.5.jar:5.6.5]
	at org.elasticsearch.indices.flush.SyncedFlushService$SyncedFlushTransportHandler.messageReceived(SyncedFlushService.java:700) ~[elasticsearch-5.6.5.jar:5.6.5]
	at org.elasticsearch.transport.TransportRequestHandler.messageReceived(TransportRequestHandler.java:33) ~[elasticsearch-5.6.5.jar:5.6.5]
	at org.elasticsearch.transport.RequestHandlerRegistry.processMessageReceived(RequestHandlerRegistry.java:69) ~[elasticsearch-5.6.5.jar:5.6.5]
	at org.elasticsearch.transport.TransportService$7.doRun(TransportService.java:654) ~[elasticsearch-5.6.5.jar:5.6.5]
	at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:638) ~[elasticsearch-5.6.5.jar:5.6.5]
	at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37) ~[elasticsearch-5.6.5.jar:5.6.5]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) ~[?:1.8.0_121]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) ~[?:1.8.0_121]
	at java.lang.Thread.run(Thread.java:745) [?:1.8.0_121]
@colings86
Copy link
Contributor

@boaz are you able to take a look at this?

@bleskes
Copy link
Contributor

bleskes commented Dec 18, 2017

I already did ;) The problem is that Lucene doesn't consider a delete of a non existent doc a "pending uncommitted change", so we skip executing a commit on the pre-synced flush commit and we also don't fail the synced flush due to pending op. We do however insert the delete into the version map even if the doc is not found due to external versioning semantics. I need to discuss it with @s1monw, I don't' have a solution I'm happy with at the moment

@s1monw s1monw self-assigned this Dec 18, 2017
s1monw added a commit to s1monw/elasticsearch that referenced this issue Dec 18, 2017
s1monw added a commit to s1monw/elasticsearch that referenced this issue Dec 20, 2017
We used to shrink the version map under an external lock. This is
quite ambigious and instead we can simply issue an empty refresh to
shrink it.

Closes elastic#27852
s1monw added a commit that referenced this issue Dec 20, 2017
We used to shrink the version map under an external lock. This is
quite ambigious and instead we can simply issue an empty refresh to
shrink it.

Closes #27852
s1monw added a commit that referenced this issue Dec 20, 2017
We used to shrink the version map under an external lock. This is
quite ambigious and instead we can simply issue an empty refresh to
shrink it.

Closes #27852
s1monw added a commit that referenced this issue Dec 20, 2017
We used to shrink the version map under an external lock. This is
quite ambigious and instead we can simply issue an empty refresh to
shrink it.

Closes #27852
s1monw added a commit that referenced this issue Dec 20, 2017
We used to shrink the version map under an external lock. This is
quite ambigious and instead we can simply issue an empty refresh to
shrink it.

Closes #27852
s1monw added a commit that referenced this issue Dec 20, 2017
We used to shrink the version map under an external lock. This is
quite ambigious and instead we can simply issue an empty refresh to
shrink it.

Closes #27852
@clintongormley clintongormley added :Distributed/Distributed A catch all label for anything in the Distributed Area. If you aren't sure, use this one. :Distributed/Engine Anything around managing Lucene and the Translog in an open shard. and removed :Engine :Distributed/Distributed A catch all label for anything in the Distributed Area. If you aren't sure, use this one. labels Feb 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Distributed/Engine Anything around managing Lucene and the Translog in an open shard.
Projects
None yet
Development

No branches or pull requests

5 participants