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

Exception while creating a PIT with high level client #13144

Open
aravind-musigumpula opened this issue Apr 10, 2024 · 8 comments
Open

Exception while creating a PIT with high level client #13144

aravind-musigumpula opened this issue Apr 10, 2024 · 8 comments
Labels
bug Something isn't working Clients Clients within the Core repository such as High level Rest client and low level client

Comments

@aravind-musigumpula
Copy link

aravind-musigumpula commented Apr 10, 2024

Describe the bug

I am using opensearch rest high level client 2.12.0 and java version 21.
While trying to create a PIT in opensearch, getting the below exception:

java.lang.IllegalArgumentException: cannot write xcontent for unknown value of type class org.opensearch.common.unit.TimeValue
	at org.opensearch.core.xcontent.XContentBuilder.unknownValue(XContentBuilder.java:863)
	at org.opensearch.core.xcontent.XContentBuilder.value(XContentBuilder.java:834)
	at org.opensearch.core.xcontent.XContentBuilder.field(XContentBuilder.java:819)
	at org.opensearch.action.search.CreatePitRequest.toXContent(CreatePitRequest.java:185)
	at org.opensearch.core.xcontent.XContentHelper.toXContent(XContentHelper.java:46)
	at org.opensearch.client.RequestConverters.createEntity(RequestConverters.java:829)
	at org.opensearch.client.RequestConverters.createEntity(RequestConverters.java:825)
	at org.opensearch.client.RequestConverters.createPit(RequestConverters.java:498)
	at org.opensearch.client.RestHighLevelClient.internalPerformRequest(RestHighLevelClient.java:1914)
	at org.opensearch.client.RestHighLevelClient.performRequest(RestHighLevelClient.java:1884)
	at org.opensearch.client.RestHighLevelClient.performRequestAndParseEntity(RestHighLevelClient.java:1852)
	at org.opensearch.client.RestHighLevelClient.createPit(RestHighLevelClient.java:1273)
	at io.trino.plugin.opensearch.client.BackpressureRestHighLevelClient.lambda$createPointInTime$3(BackpressureRestHighLevelClient.java:150)
	at dev.failsafe.Functions.lambda$toCtxSupplier$11(Functions.java:243)
	at dev.failsafe.Functions.lambda$get$0(Functions.java:46)
	at dev.failsafe.internal.RetryPolicyExecutor.lambda$apply$0(RetryPolicyExecutor.java:74)
	at dev.failsafe.SyncExecutionImpl.executeSync(SyncExecutionImpl.java:187)
	at dev.failsafe.FailsafeExecutor.call(FailsafeExecutor.java:376)
	at dev.failsafe.FailsafeExecutor.get(FailsafeExecutor.java:112)
	at io.trino.plugin.opensearch.client.BackpressureRestHighLevelClient.executeWithRetries(BackpressureRestHighLevelClient.java:129)
	at io.trino.plugin.opensearch.client.BackpressureRestHighLevelClient.createPointInTime(BackpressureRestHighLevelClient.java:150)
	at io.trino.plugin.opensearch.client.OpenSearchClient.createPITRequest(OpenSearchClient.java:601)
	at io.trino.plugin.opensearch.OpenSearchSplitManager.getSplits(OpenSearchSplitManager.java:70)
	at io.trino.split.SplitManager.getSplits(SplitManager.java:89)
	at io.trino.sql.planner.SplitSourceFactory$Visitor.createSplitSource(SplitSourceFactory.java:183)
	at io.trino.sql.planner.SplitSourceFactory$Visitor.visitFilter(SplitSourceFactory.java:254)
	at io.trino.sql.planner.SplitSourceFactory$Visitor.visitFilter(SplitSourceFactory.java:130)
	at io.trino.sql.planner.plan.FilterNode.accept(FilterNode.java:74)
	at io.trino.sql.planner.SplitSourceFactory.createSplitSources(SplitSourceFactory.java:110)
	at io.trino.execution.scheduler.PipelinedQueryScheduler$DistributedStagesScheduler.createStageScheduler(PipelinedQueryScheduler.java:1051)
	at io.trino.execution.scheduler.PipelinedQueryScheduler$DistributedStagesScheduler.create(PipelinedQueryScheduler.java:927)

Any idea how to solve this?

Related component

Clients

To Reproduce

  1. I am using opensource 2.12
  2. I have created index as follows:
curl -XPUT "http://localhost:9200/users" -H 'Content-Type: application/json' -d '
{
    "settings" : {
        "number_of_shards" : 4
    }
}'
  1. I am using trinodb as connector to read data from opensource, Creating the PIT as follows:
    CreatePitRequest pitRequest = new CreatePitRequest(new TimeValue(60000), true, index); restHighLevelClient.createPit(pitRequest, RequestOptions.DEFAULT));

  2. During the above call with rest high level client, getting an exception when sdk is trying to build the request before hitting opensource.

Expected behavior

When creating PIT using high level client, PIT should be created and PITResponse should be returned.

Additional Details

Plugins
Please list all plugins currently enabled.

Screenshots
If applicable, add screenshots to help explain your problem.

Host/Environment (please complete the following information):

  • OS: [e.g. iOS]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

@aravind-musigumpula aravind-musigumpula added bug Something isn't working untriaged labels Apr 10, 2024
@github-actions github-actions bot added the Clients Clients within the Core repository such as High level Rest client and low level client label Apr 10, 2024
@Hailong-am
Copy link

@aravind-musigumpula can you share your createPitRequest?

@peternied
Copy link
Member

[Triage - attendees 1 2 3 4 5 6]
@aravind-musigumpula thanks for creating this issue - it would be helpful if you could update the descriptions repro steps as @Hailong-am requested.

@aravind-musigumpula
Copy link
Author

aravind-musigumpula commented Apr 11, 2024

@peternied @Hailong-am
This is how I am creating PIT request

CreatePitRequest pitRequest = new CreatePitRequest(new TimeValue(60000), true, index); restHighLevelClient.createPit(pitRequest, RequestOptions.DEFAULT));

@peternied
Copy link
Member

@aravind-musigumpula Could you writing out the step by step instructions including create the index, populating it and then the request to create the PIT? For example see this bug that has specific reproduction steps and expectations for them [1]

Alternatively, if you update one of the test cases to reproduce the failure that would be good too, then you can publish a draft PR so it can be shared and investigated by members of the community, what do you think?

@aravind-musigumpula
Copy link
Author

Hi @peternied
If you see the stack trace provided, Request haven't reached opensource yet. It failed when building request for opensource.
So irrespective of how the index is created, we get this error.(Added the steps)

@Hailong-am
Copy link

thanks @aravind-musigumpula, i am trying to setup same in my local to see whether i can reproduce this error

@aravind-musigumpula
Copy link
Author

Some similar issues I have found :
elastic/elasticsearch#31853
elastic/elasticsearch#68617

@Hailong-am
Copy link

elastic/elasticsearch#68617

By looking into this, it should be same cause as explained elastic/elasticsearch#68617 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Clients Clients within the Core repository such as High level Rest client and low level client
Projects
None yet
Development

No branches or pull requests

3 participants