PENDING SEGMENT RELATED ISSUE : Duplicate entry for key

org.skife.jdbi.v2.exceptions.CallbackFailedException: org.skife.jdbi.v2.exceptions.UnableToExecuteStatementException: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry ‘8EC4604808F5467421EEACBA8AB48B930D003154’ for key ‘sequence_name_prev_id_sha1’ [statement:“INSERT INTO druid_pendingSegments (id, dataSource, created_date, start, end, sequence_name, sequence_prev_id, sequence_name_prev_id_sha1, payload) VALUES (:id, :dataSource, :created_date, :start, :end, :sequence_name, :sequence_prev_id, :sequence_name_prev_id_sha1, :payload)”, located:“INSERT INTO druid_pendingSegments (id, dataSource, created_date, start, end, sequence_name, sequence_prev_id, sequence_name_prev_id_sha1, payload) VALUES (:id, :dataSource, :created_date, :start, :end, :sequence_name, :sequence_prev_id, :sequence_name_prev_id_sha1, :payload)”, rewritten:“INSERT INTO druid_pendingSegments (id, dataSource, created_date, start, end, sequence_name, sequence_prev_id, sequence_name_prev_id_sha1, payload) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)”, arguments:{ positional:{}, named:{sequence_prev_id:‘jarvis_cxcsense_2018-11-17T12:03:00.000Z_2018-11-17T12:04:00.000Z_2018-11-19T00:19:18.075Z_4’,payload:[123, 34, 100, 97, 116, 97, 83, 111, 117, 114, 99, 101, 34, 58, 34, 106, 97, 114, 118, 105, 115, 95, 99, 120, 99, 115, 101, 110, 115, 101, 34, 44, 34, 105, 110, 116, 101, 114, 118, 97, 108, 34, 58, 34, 50, 48, 49, 56, 45, 49, 49, 45, 49, 55, 84, 49, 51, 58, 51, 51, 58, 48, 48, 46, 48, 48, 48, 90, 47, 50, 48, 49, 56, 45, 49, 49, 45, 49, 55, 84, 49, 51, 58, 51, 52, 58, 48, 48, 46, 48, 48, 48, 90, 34, 44, 34, 118, 101, 114, 115, 105, 111, 110, 34, 58, 34, 50, 48, 49, 56, 45, 49, 49, 45, 49, 57, 84, 48, 48, 58, 49, 56, 58, 51, 49, 46, 48, 55, 57, 90, 34, 44, 34, 115, 104, 97, 114, 100, 83, 112, 101, 99, 34, 58, 123, 34, 116, 121, 112, 101, 34, 58, 34, 110, 117, 109, 98, 101, 114, 101, 100, 34, 44, 34, 112, 97, 114, 116, 105, 116, 105, 111, 110, 78, 117, 109, 34, 58, 52, 44, 34, 112, 97, 114, 116, 105, 116, 105, 111, 110, 115, 34, 58, 48, 125, 125],start:‘2018-11-17T13:33:00.000Z’,end:‘2018-11-17T13:34:00.000Z’,id:‘jarvis_cxcsense_2018-11-17T13:33:00.000Z_2018-11-17T13:34:00.000Z_2018-11-19T00:18:31.079Z_4’,created_date:‘2018-11-21T04:47:41.434Z’,dataSource:‘jarvis_cxcsense’,sequence_name:‘index_kafka_jarvis_cxcsense_d6db99790657258_0’,sequence_name_prev_id_sha1:‘8EC4604808F5467421EEACBA8AB48B930D003154’}, finder:}]

at org.skife.jdbi.v2.DBI.withHandle(DBI.java:284) ~[jdbi-2.63.1.jar:2.63.1]

at org.skife.jdbi.v2.DBI.inTransaction(DBI.java:329) ~[jdbi-2.63.1.jar:2.63.1]

at io.druid.metadata.SQLMetadataConnector$3.call(SQLMetadataConnector.java:158) ~[druid-server-0.12.1.3.0.0.0-1634.jar:0.12.1.3.0.0.0-1634]

at io.druid.java.util.common.RetryUtils.retry(RetryUtils.java:63) [java-util-0.12.1.3.0.0.0-1634.jar:0.12.1.3.0.0.0-1634]

at io.druid.metadata.SQLMetadataConnector.retryTransaction(SQLMetadataConnector.java:162) [druid-server-0.12.1.3.0.0.0-1634.jar:0.12.1.3.0.0.0-1634]

at io.druid.metadata.IndexerSQLMetadataStorageCoordinator.allocatePendingSegment(IndexerSQLMetadataStorageCoordinator.java:399) [druid-server-0.12.1.3.0.0.0-1634.jar:0.12.1.3.0.0.0-1634]

at io.druid.indexing.common.actions.SegmentAllocateAction.tryAllocate(SegmentAllocateAction.java:272) [druid-indexing-service-0.12.1.3.0.0.0-1634.jar:0.12.1.3.0.0.0-1634]

at io.druid.indexing.common.actions.SegmentAllocateAction.tryAllocateSubsequentSegment(SegmentAllocateAction.java:248) [druid-indexing-service-0.12.1.3.0.0.0-1634.jar:0.12.1.3.0.0.0-1634]

at io.druid.indexing.common.actions.SegmentAllocateAction.perform(SegmentAllocateAction.java:170) [druid-indexing-service-0.12.1.3.0.0.0-1634.jar:0.12.1.3.0.0.0-1634]

at io.druid.indexing.common.actions.SegmentAllocateAction.perform(SegmentAllocateAction.java:56) [druid-indexing-service-0.12.1.3.0.0.0-1634.jar:0.12.1.3.0.0.0-1634]

at io.druid.indexing.common.actions.LocalTaskActionClient.submit(LocalTaskActionClient.java:64) [druid-indexing-service-0.12.1.3.0.0.0-1634.jar:0.12.1.3.0.0.0-1634]

at io.druid.indexing.overlord.http.OverlordResource$3.apply(OverlordResource.java:345) [druid-indexing-service-0.12.1.3.0.0.0-1634.jar:0.12.1.3.0.0.0-1634]

at io.druid.indexing.overlord.http.OverlordResource$3.apply(OverlordResource.java:334) [druid-indexing-service-0.12.1.3.0.0.0-1634.jar:0.12.1.3.0.0.0-1634]

at io.druid.indexing.overlord.http.OverlordResource.asLeaderWith(OverlordResource.java:672) [druid-indexing-service-0.12.1.3.0.0.0-1634.jar:0.12.1.3.0.0.0-1634]

at io.druid.indexing.overlord.http.OverlordResource.doAction(OverlordResource.java:331) [druid-indexing-service-0.12.1.3.0.0.0-1634.jar:0.12.1.3.0.0.0-1634]

at sun.reflect.GeneratedMethodAccessor123.invoke(Unknown Source) ~[?:?]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_112]

at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_112]

at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60) [jersey-server-1.19.3.jar:1.19.3]

at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$ResponseOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:205) [jersey-server-1.19.3.jar:1.19.3]

at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75) [jersey-server-1.19.3.jar:1.19.3]

at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:302) [jersey-server-1.19.3.jar:1.19.3]

at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147) [jersey-server-1.19.3.jar:1.19.3]

at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108) [jersey-server-1.19.3.jar:1.19.3]

at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147) [jersey-server-1.19.3.jar:1.19.3]

at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84) [jersey-server-1.19.3.jar:1.19.3]

at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1542) [jersey-server-1.19.3.jar:1.19.3]

at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1473) [jersey-server-1.19.3.jar:1.19.3]

at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1419) [jersey-server-1.19.3.jar:1.19.3]

at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1409) [jersey-server-1.19.3.jar:1.19.3]

at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:409) [jersey-servlet-1.19.3.jar:1.19.3]

at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:558) [jersey-servlet-1.19.3.jar:1.19.3]

at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:733) [jersey-servlet-1.19.3.jar:1.19.3]

at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) [javax.servlet-api-3.1.0.jar:3.1.0]

at com.google.inject.servlet.ServletDefinition.doServiceImpl(ServletDefinition.java:286) [guice-servlet-4.1.0.jar:?]

at com.google.inject.servlet.ServletDefinition.doService(ServletDefinition.java:276) [guice-servlet-4.1.0.jar:?]

at com.google.inject.servlet.ServletDefinition.service(ServletDefinition.java:181) [guice-servlet-4.1.0.jar:?]

at com.google.inject.servlet.ManagedServletPipeline.service(ManagedServletPipeline.java:91) [guice-servlet-4.1.0.jar:?]

at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:85) [guice-servlet-4.1.0.jar:?]

at com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilterPipeline.java:120) [guice-servlet-4.1.0.jar:?]

at com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:135) [guice-servlet-4.1.0.jar:?]

at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1759) [jetty-servlet-9.3.19.v20170502.jar:9.3.19.v20170502]

at io.druid.server.http.RedirectFilter.doFilter(RedirectFilter.java:72) [druid-server-0.12.1.3.0.0.0-1634.jar:0.12.1.3.0.0.0-1634]

at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1759) [jetty-servlet-9.3.19.v20170502.jar:9.3.19.v20170502]

at io.druid.server.security.PreResponseAuthorizationCheckFilter.doFilter(PreResponseAuthorizationCheckFilter.java:84) [druid-server-0.12.1.3.0.0.0-1634.jar:0.12.1.3.0.0.0-1634]

at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1759) [jetty-servlet-9.3.19.v20170502.jar:9.3.19.v20170502]

at io.druid.server.security.AllowOptionsResourceFilter.doFilter(AllowOptionsResourceFilter.java:76) [druid-server-0.12.1.3.0.0.0-1634.jar:0.12.1.3.0.0.0-1634]

at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1759) [jetty-servlet-9.3.19.v20170502.jar:9.3.19.v20170502]

at io.druid.server.security.AllowAllAuthenticator$1.doFilter(AllowAllAuthenticator.java:85) [druid-server-0.12.1.3.0.0.0-1634.jar:0.12.1.3.0.0.0-1634]

at io.druid.server.security.AuthenticationWrappingFilter.doFilter(AuthenticationWrappingFilter.java:60) [druid-server-0.12.1.3.0.0.0-1634.jar:0.12.1.3.0.0.0-1634]

at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1759) [jetty-servlet-9.3.19.v20170502.jar:9.3.19.v20170502]

at io.druid.server.security.SecuritySanityCheckFilter.doFilter(SecuritySanityCheckFilter.java:88) [druid-server-0.12.1.3.0.0.0-1634.jar:0.12.1.3.0.0.0-1634]

at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1759) [jetty-servlet-9.3.19.v20170502.jar:9.3.19.v20170502]

at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:582) [jetty-servlet-9.3.19.v20170502.jar:9.3.19.v20170502]

at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:224) [jetty-server-9.3.19.v20170502.jar:9.3.19.v20170502]

at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1180) [jetty-server-9.3.19.v20170502.jar:9.3.19.v20170502]

at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:512) [jetty-servlet-9.3.19.v20170502.jar:9.3.19.v20170502]

at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185) [jetty-server-9.3.19.v20170502.jar:9.3.19.v20170502]

at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1112) [jetty-server-9.3.19.v20170502.jar:9.3.19.v20170502]

at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) [jetty-server-9.3.19.v20170502.jar:9.3.19.v20170502]

at org.eclipse.jetty.server.handler.gzip.GzipHandler.handle(GzipHandler.java:493) [jetty-server-9.3.19.v20170502.jar:9.3.19.v20170502]

at org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:52) [jetty-server-9.3.19.v20170502.jar:9.3.19.v20170502]

at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134) [jetty-server-9.3.19.v20170502.jar:9.3.19.v20170502]

at org.eclipse.jetty.server.Server.handle(Server.java:534) [jetty-server-9.3.19.v20170502.jar:9.3.19.v20170502]

at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:320) [jetty-server-9.3.19.v20170502.jar:9.3.19.v20170502]

at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:251) [jetty-server-9.3.19.v20170502.jar:9.3.19.v20170502]

at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:283) [jetty-io-9.3.19.v20170502.jar:9.3.19.v20170502]

at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:108) [jetty-io-9.3.19.v20170502.jar:9.3.19.v20170502]

at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93) [jetty-io-9.3.19.v20170502.jar:9.3.19.v20170502]

at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303) [jetty-util-9.3.19.v20170502.jar:9.3.19.v20170502]

at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:148) [jetty-util-9.3.19.v20170502.jar:9.3.19.v20170502]

at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:136) [jetty-util-9.3.19.v20170502.jar:9.3.19.v20170502]

at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671) [jetty-util-9.3.19.v20170502.jar:9.3.19.v20170502]

at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589) [jetty-util-9.3.19.v20170502.jar:9.3.19.v20170502]

at java.lang.Thread.run(Thread.java:745) [?:1.8.0_112]