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

/query endpoint doesn't respond sporadically if more than one client tries to run a query. #7172

Closed
maksymilian-gasztych opened this issue Mar 8, 2021 · 5 comments
Assignees
Labels
bug P0 Denotes must-have for a given milestone query-engine Issues owned by the ksqlDB Query Engine team
Milestone

Comments

@maksymilian-gasztych
Copy link

maksymilian-gasztych commented Mar 8, 2021

Describe the bug
/query endpoint doesn't return any response around one in ten times if if there are at least 2 simultaneous clients querying it.
If there are much more simultaneous clients it even stops responding completely.

I also created this ticket, but I managed to get some more details that I included here, so closing that one

To Reproduce

  1. Create any stream or table
    CREATE STREAM test3 (id INT KEY,one DECIMAl(5,5),two DECIMAL(5,2))WITH (kafka_topic='test', partitions=2, value_format='json');
  2. query using curl
 curl -X "POST" "http://localhost:28088/query" \
-H "Accept: application/vnd.ksql.v1+json" \
-d $'{
"ksql": "select one,two,one/two from test3 emit changes;",
"streamsProperties": {}
}'
  1. Open ksql CLI and try to run the query around 10 times, the cli will hang unresponsive untli you kill the curl request.
    select one,two,one/two from test3 emit changes;

Expected behavior
/query endpoint works for more than one client without any issues

Actual behaviour
No response is returned

Additional context
Verified on 0.14.0 and 0.15.0
Just in case attaching docker settings I'm using

confluentinc/ksqldb-server:0.15.0 settings:

      KSQL_KSQL_SERVICE_ID: "cluster"
      KSQL_LISTENERS: "http://0.0.0.0:8088"
      KSQL_BOOTSTRAP_SERVERS: "broker:9092"
      KSQL_KSQL_SCHEMA_REGISTRY_URL: "http://schema-registry:8081"
      KSQL_KSQL_LOGGING_PROCESSING_STREAM_AUTO_CREATE: "true"
      KSQL_KSQL_LOGGING_PROCESSING_TOPIC_AUTO_CREATE: "true"
      KSQL_CONNECT_GROUP_ID: "ksql-connect-cluster"
      KSQL_CONNECT_BOOTSTRAP_SERVERS: "broker:9092"
      KSQL_CONNECT_KEY_CONVERTER: "org.apache.kafka.connect.storage.StringConverter"
      KSQL_CONNECT_VALUE_CONVERTER: "io.confluent.connect.avro.AvroConverter"
      KSQL_CONNECT_KEY_CONVERTER_SCHEMA_REGISTRY_URL: "http://schema-registry:8081"
      KSQL_CONNECT_VALUE_CONVERTER_SCHEMA_REGISTRY_URL: "http://schema-registry:8081"
      KSQL_CONNECT_CONFIG_STORAGE_TOPIC: "ksql-connect-configs"
      KSQL_CONNECT_OFFSET_STORAGE_TOPIC: "ksql-connect-offsets"
      KSQL_CONNECT_STATUS_STORAGE_TOPIC: "ksql-connect-statuses"
      KSQL_CONNECT_CONFIG_STORAGE_REPLICATION_FACTOR: 1
      KSQL_CONNECT_OFFSET_STORAGE_REPLICATION_FACTOR: 1
      KSQL_CONNECT_STATUS_STORAGE_REPLICATION_FACTOR: 1
      KSQL_CONNECT_REST_ADVERTISED_HOST_NAME: "ksqldb-server"

confluentinc/cp-schema-registry:6.1.0 settings:

      SCHEMA_REGISTRY_HOST_NAME: schema-registry
      SCHEMA_REGISTRY_KAFKASTORE_BOOTSTRAP_SERVERS: 'broker:9092'
      SCHEMA_REGISTRY_LISTENERS: "http://0.0.0.0:8081"
      SCHEMA_REGISTRY_GROUP_ID: "cp-schema-registry-cluster"
      SCHEMA_REGISTRY_SCHEMA_COMPATIBILITY_LEVEL: "forward"

confluentinc/cp-enterprise-kafka:6.0.0 settings:

      KAFKA_BROKER_ID: 1
      KAFKA_ZOOKEEPER_CONNECT: 'zookeeper:2181'
      KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT
      KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://broker:9092,PLAINTEXT_HOST://localhost:29092
      KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
      KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: 0
      KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1
      KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1
@rodesai rodesai added streaming-engine Tickets owned by the ksqlDB Streaming Team query-engine Issues owned by the ksqlDB Query Engine team and removed streaming-engine Tickets owned by the ksqlDB Streaming Team labels Mar 10, 2021
@agavra agavra added the P0 Denotes must-have for a given milestone label Mar 15, 2021
@agavra
Copy link
Contributor

agavra commented Mar 16, 2021

Thanks for the details @maksymilian-gasztych! Just noting to the team that I was able to reproduce it locally - seems like some fascinating race condition.

@maksymilian-gasztych
Copy link
Author

Glad that you were able to reproduce it too. Hopefully it's an easy fix, or that you can implement tombstone support for /query-strem endpoint, because it's a very big issue. I'm honestly surprised that noone has yet encountered it.

@agavra agavra added this to the 0.19.0 milestone Mar 22, 2021
@agavra
Copy link
Contributor

agavra commented Mar 22, 2021

0.19 timeline to understand exactly what the impact is, and hopefully fix it as well

@vvcephei
Copy link
Member

Ok, I've got a fix here: #7420

@vvcephei
Copy link
Member

This should be fixed in 0.18 via #7420

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug P0 Denotes must-have for a given milestone query-engine Issues owned by the ksqlDB Query Engine team
Projects
None yet
Development

No branches or pull requests

4 participants