Skip to content

Instantly share code, notes, and snippets.

View umeshdangat's full-sized avatar

Umesh Dangat umeshdangat

View GitHub Profile
@umeshdangat
umeshdangat / ProfileWeight breaks derived expressions
Created August 8, 2018 21:30
ProfileWeight breaks derived expressions
org.elasticsearch.transport.RemoteTransportException: [node-0][127.0.0.1:9300][indices:data/read/search[phase/query]]
Caused by: java.lang.UnsupportedOperationException: This Weight cannot work outside the RankerQuery context: you must call scorer(context, vectorSupplier)
at com.o19s.es.ltr.query.FeatureVectorWeight.scorer(FeatureVectorWeight.java:39) ~[?:?]
at org.apache.lucene.search.Weight.scorerSupplier(Weight.java:113) ~[lucene-core-7.3.1.jar:7.3.1 ae0705edb59eaa567fe13ed3a222fdadc7153680 - caomanhdat - 2018-05-09 09:27:24]
at org.elasticsearch.search.profile.query.ProfileWeight.scorerSupplier(ProfileWeight.java:66) ~[elasticsearch-6.3.1-SNAPSHOT.jar:6.3.1-SNAPSHOT]
at org.elasticsearch.search.profile.query.ProfileWeight.scorer(ProfileWeight.java:53) ~[elasticsearch-6.3.1-SNAPSHOT.jar:6.3.1-SNAPSHOT]
at com.o19s.es.ltr.query.RankerQuery$RankerWeight.scorer(RankerQuery.java:257) ~[?:?]
at com.o19s.es.ltr.query.RankerQuery$RankerWeight.scorer(RankerQuery.java:191) ~[?:?]
at org.apache.lucene.search.
{
"error": {
"root_cause": [
{
"type": "unsupported_operation_exception",
"reason": "This Weight cannot work outside the RankerQuery context: you must call scorer(context, vectorSupplier)"
}
],
"type": "search_phase_execution_exception",
"reason": "all shards failed",
@umeshdangat
umeshdangat / gist:da1948e693754dc3575750218195d0b6
Created September 1, 2018 00:09
scriptfeature_diff_param_names_ltr_vs_es_script
"model": {
"name": "my_simple_linear_model_1",
"feature_set": {
"name": "simple_painless_features",
"features": [
{
"name": "feature1",
"params": [
"feature1_param"
],
[2018-09-18T14:58:39,141][DEBUG][o.e.a.s.TransportSearchAction] [10-40-10-64-uswest1adevc.dev.yelpcorp.com] [125071] Failed to execute fetch phase
org.elasticsearch.transport.RemoteTransportException: [10-40-11-210-uswest1adevc.dev.yelpcorp.com][10.40.11.210:14901][indices:data/read/search[phase/fetch/id]]
Caused by: org.elasticsearch.common.io.stream.NotSerializableExceptionWrapper: concurrent_modification_exception: Removal from the cache failed! This is probably due to a query which has been modified after having been put into the cache or a badly implemented clone(). Query class: [class com.o19s.es.ltr.query.RankerQuery], query: [rankerquery:]
at org.apache.lucene.search.LRUQueryCache.evictIfNecessary(LRUQueryCache.java:338) ~[lucene-core-7.3.1.jar:7.3.1 ae0705edb59eaa567fe13ed3a222fdadc7153680 - caomanhdat - 2018-05-09 09:27:24]
at org.apache.lucene.search.LRUQueryCache.putIfAbsent(LRUQueryCache.java:317) ~[lucene-core-7.3.1.jar:7.3.1 ae0705edb59eaa567fe13ed3a222fdadc7153680 - caomanhdat - 2018-05-09
dcausse [8:05 AM]
@umesh do you use ScriptFeature in the scenario where the query cache fails? This is the only query in the ltr plugin that may perform a hashCode/equals on a mutable object.
Also when you said you returned false from isCacheable() you also had to do it from the ConstantScoreWeight returned from RankerQuery::createWeight ?
For me the scenario for this to happen would be:
you use named filters to do logging (using _name = 'ltr_query_log' on sltr) under a filter, this will force the query to be cached
when logging it'll reuse the same Query object but will populate the FeatureSupplier in LtrScript query causing hashCode to change (edited)
umesh [8:15 AM]
do you use ScriptFeature in the scenario where the query cache fails? yes
@umeshdangat
umeshdangat / concurrent modification exception
Created September 21, 2018 15:37
concurrent modification exception
[2018-09-18T14:58:39,115][DEBUG][o.e.a.s.TransportSearchAction] [10-40-23-13-uswest1cdevc.dev.yelpcorp.com] [2018-08-17-americas_west_south_dev][18], node[dw3mfBeQSGiDt5Ti7Y7jCA], [R], s[STARTED], a[id=O0t1MmPWTKSbLV9gxu2FuA]: Failed to execute [SearchRequest{searchType=QUERY_THEN_FETCH, indices=[americas_west_south_dev], indicesOptions=IndicesOptions[id=38, ignore_unavailable=false, allow_no_indices=true, expand_wildcards_open=true, expand_wildcards_closed=false, allow_aliases_to_multiple_indices=true, forbid_closed_indices=true, ignore_aliases=false], types=[], routing='null', preference='null', requestCache=null, scroll=null, maxConcurrentShardRequests=80, batchedReduceSize=512, preFilterShardSize=128, allowPartialSearchResults=true, source={"from":0,"size":10,"query":{"function_score":{"query":{"bool":{"filter":[{"geo_bounding_box":{"location":{"top_left":[-117.56195068359376,33.135251282563836],"bottom_right":[-116.74346923828124,32.442567075075075]},"validation_method":"STRICT","type":"MEMORY","ignore_u
@umeshdangat
umeshdangat / platypus_api.png
Created October 4, 2019 19:24
Platypus API
snapshot of platypus api
@umeshdangat
umeshdangat / platypus_api.png
Last active October 4, 2019 19:35
platypus protobuff api
platypus_api.png
diff --git a/src/main/java/org/apache/platypus/server/luceneserver/ShardState.java b/src/main/java/org/apache/platypus/server/luceneserver/ShardState.java
index 273c352..5403c61 100644
--- a/src/main/java/org/apache/platypus/server/luceneserver/ShardState.java
+++ b/src/main/java/org/apache/platypus/server/luceneserver/ShardState.java
@@ -314,17 +314,21 @@ public class ShardState implements Closeable {
*/
public synchronized long commit() throws IOException {
- long gen;
+ long gen = -1;