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

Re-deployed stream does not retain user provided properties #5375

Open
onobc opened this issue Jun 10, 2023 · 0 comments
Open

Re-deployed stream does not retain user provided properties #5375

onobc opened this issue Jun 10, 2023 · 0 comments

Comments

@onobc
Copy link
Contributor

onobc commented Jun 10, 2023

Description
When a stream is re-deployed (undeployed and then deployed again) some user provided properties are not retained exactly as they are entered by the user. An example is app.<name>.producer.partitionKeyExpression - which will be translated to app.<name>.spring.cloud.stream.bindings.output.producer.partitionKeyExpression.

This was noticed (#4896) as some logic will attempt to extract app properties using the original entered property names (prefixed with app.*).

Steps tp reproduce:

  • Navigate to SCDF UI
  • Add the Kafka OOTB apps
  • Create a stream definition using http | splitter | log
  • Deploy the stream - enter the following props in the "Freeform" prop editor tab:
    app.http.server.port=8181
    app.splitter.expression=payload.split(' ')
    app.splitter.producer.partitionKeyExpression=headers['payload']
    app.splitter.spring.cloud.stream.kafka.binder.autoAddPartitions=true
    app.splitter.spring.cloud.stream.kafka.binder.minPartitionCount=4
    deployer.log.count=4
    
  • View the retained props
    • Choose "Update Stream" from stream details page
    • Click the "Freeform" edit of the properties
    • Notice the app.splitter.producer.partitionKeyExpression property is now named app.splitter.spring.cloud.stream.bindings.output.producer.partitionKeyExpression.

⚠️ 💣 ⚠️ This is a problem because subsequent deploys will attempt to extract app properties but will not find this one.

To illustrate this problem, we will re-deploy the stream and scale the log sink instances down from 4 to 2.
As part of that flow, when the upstream app (splitter) is partitioned it should adjust the producer partition count to match.
Note that It is considered partitioned if it has the partitionKeyExpression property (extracted from the app.* props).

Steps

  • Undeploy the stream
  • Deploy the stream
  • Deploy the stream
    • Navigate to the "Freeform" props editor
    • You will see MANY properties from original
    • Edit the deployer.log.count=4 and set it to deployer.log.count=2
    • Click "Deploy"
  • View the retained props
    • Choose "Update Stream" from stream details page
    • Click the "Freeform" edit of the properties
    • 💥 💥 Notice the app.splitter.spring.cloud.stream.bindings.output.producer.partitionCount=4 which should be 2 to match the log sink count.

To illustrate the expected behavior, we will manually enter the app.* property on the re-deploy and watch the partitionCount be modified as expected.

Steps:

  • Undeploy the stream
  • Deploy the stream
  • Navigate to the "Freeform" props editor
  • You will see MANY properties from original
  • Edit the deployer.log.count=2 and set it to deployer.log.count=1
  • Also enter app.splitter.producer.partitionKeyExpression=headers['payload']
  • Deploy the stream
  • View the retained props
    • Choose "Update Stream" from stream details page
    • Click the "Freeform" edit of the properties
    • 🎉 🎉 Notice the app.splitter.spring.cloud.stream.bindings.output.producer.partitionCount=1 as expected - it was moved from 2 to 1 to match the log sink count.

Solution:
Either

  1. the app.* props should be retained exactly as entered on subsequent deploys OR
  2. the user should know they must re-enter the initial props they entered exactly as the 1st deploy (app.*) OR
  3. the logic used to determine if the upstream app is partitioned should be smarter to look in other props besides the app.* props.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant