david-streamlio opened a new issue #10720:
URL: https://github.com/apache/pulsar/issues/10720


   **Describe the bug**
   When using the /pulsar-admin functions update command to update an existing 
function instance. If you only provide the `--parallelism` flag, then the 
previously provided user-configs settings get deleted.
   
   **To Reproduce**
   Steps to reproduce the behavior:
   1. Create a Pulsar Function from the CLI providing a value for the 
`--user-config` switch, e.g. `bin/pulsar-admin functions create   --jar 
/streamlio/connectors/test-functions-1.0.0.nar   --classname 
com.manning.pulsar.loadgen.SumOfFibonacciFunction   --inputs 
persistent://public/default/input-1   --output 
persistent://public/default/output-1   --log-topic 
persistent://public/default/log-1   --user-config "{\"max\" : \"60\"}"   
--parallelism 10'
   2.  Verify that the Function was created and the user configs were accepted, 
e.g. `bin/pulsar-admin functions get --name SumOfFibonacciFunction`
   3. Update the parallelism setting using the /pulsar-admin functions update 
command, e.g. `bin/pulsar-admin functions update --name SumOfFibonacciFunction 
--parallelism 60` 
   4. Get the function details again, and notice that the user-configs are now 
blank, e.g. `bin/pulsar-admin functions get --name SumOfFibonacciFunction`
   
   {
     "tenant": "public",
     "namespace": "default",
     "name": "SumOfFibonacciFunction",
     "className": "com.manning.pulsar.loadgen.SumOfFibonacciFunction",
     "inputSpecs": {
       "persistent://public/default/input-1": {
         "isRegexPattern": false,
         "schemaProperties": {},
         "consumerProperties": {}
       }
     },
     "output": "persistent://public/default/output-1",
     "producerConfig": {
       "useThreadLocalProducers": false,
       "batchBuilder": ""
     },
     "logTopic": "persistent://public/default/log-1",
     "processingGuarantees": "ATLEAST_ONCE",
     "retainOrdering": false,
     "retainKeyOrdering": false,
     "forwardSourceMessageProperty": true,
     **"userConfig": {},**
     "runtime": "JAVA",
     "autoAck": true,
     "parallelism": 60,
     "resources": {
       "cpu": 1.0,
       "ram": 1073741824,
       "disk": 10737418240
     },
     "cleanupSubscription": true
   }
   
   **Expected behavior**
   Updating the parallelism of a function should not clear out the user 
provided configuration settings.
   
   **Desktop (please complete the following information):**
    - OS: Mac
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to