confluentinc / ksql

The database purpose-built for stream processing applications.
https://ksqldb.io
Other
122 stars 1.04k forks source link

Create stream uses number of partitions for replicas #2815

Closed MichaelDrogalis closed 5 years ago

MichaelDrogalis commented 5 years ago

Running a clean build of c0784fb4f2627108be0c3a4f76c6a81a667412c1, it appears that creating a stream uses the partition count on behalf of the replica count:

CLI v5.3.0-SNAPSHOT, Server v5.3.0-SNAPSHOT located at http://localhost:8088

Having trouble? Type 'help' (case-insensitive) for a rundown of how things work!

ksql> version
Version: 5.3.0-SNAPSHOT
ksql> create stream test_stream (author varchar) with (kafka_topic='test_topic', key='author', value_format='avro', partitions=5);
Failed to guarantee existence of topic test_topic
Caused by: Replication factor: 5 larger than available brokers: 1.
ksql> create stream test_stream (author varchar) with (kafka_topic='test_topic', key='author', value_format='avro', partitions=1);

 Message        
----------------
 Stream created 
----------------

I did a little digging to make sure I wasn't running against the wrong build again, and I bisected it down to b7003623586d34f62e470f0871bfaabb7502d40e (PR https://github.com/confluentinc/ksql/pull/2785). Took a quick scan of the diff, and I think I see the culprit: https://github.com/confluentinc/ksql/blob/c0784fb4f2627108be0c3a4f76c6a81a667412c1/ksql-parser/src/main/java/io/confluent/ksql/parser/tree/CreateSourceProperties.java#L143

agavra commented 5 years ago

Oops! I'm surprised testing didn't catch that. I'll fix forward ASAP and add coverage.

On Tue, May 14, 2019 at 7:30 PM Michael Drogalis notifications@github.com wrote:

Running a clean build of c0784fb4f2627108be0c3a4f76c6a81a667412c1, it appears that creating a stream uses the partition count on behalf of the replica count:

CLI v5.3.0-SNAPSHOT, Server v5.3.0-SNAPSHOT located at http://localhost:8088

Having trouble? Type 'help' (case-insensitive) for a rundown of how things work!

ksql> version Version: 5.3.0-SNAPSHOT ksql> create stream test_stream (author varchar) with (kafka_topic='test_topic', key='author', value_format='avro', partitions=5); Failed to guarantee existence of topic test_topic Caused by: Replication factor: 5 larger than available brokers: 1. ksql> create stream test_stream (author varchar) with (kafka_topic='test_topic', key='author', value_format='avro', partitions=1);

Message

Stream created

I did a little digging to make sure I wasn't running against the wrong build again, and I bisected it down to b7003623586d34f62e470f0871bfaabb7502d40e (PR #2785 https://github.com/confluentinc/ksql/pull/2785). Took a quick scan of the diff, and I think I see the culprit: https://github.com/confluentinc/ksql/blob/c0784fb4f2627108be0c3a4f76c6a81a667412c1/ksql-parser/src/main/java/io/confluent/ksql/parser/tree/CreateSourceProperties.java#L143

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/confluentinc/ksql/issues/2815?email_source=notifications&email_token=AAYGQNLTAG6BSRZ63Z2PLBLPVMAN3A5CNFSM4HM4RQ5KYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4GTX3EWA, or mute the thread https://github.com/notifications/unsubscribe-auth/AAYGQNNJ5G3VN7I522VCEJTPVMAN3ANCNFSM4HM4RQ5A .