Apache Beam DataFlow Runner throwing error for Write to Data-store/Enforce throttling during ramp-up

Viewed 314

I recently updated my pipelines on GCP dataflow from version 2.27 to version 2.34 Pipelines using WriteToDataStore connector failed due to following error:

Error message from worker: Traceback (most recent call last): 
File "apache_beam/runners/common.py", line 1233, in apache_beam.runners.common.DoFnRunner.process 
File "apache_beam/runners/common.py", line 571, in apache_beam.runners.common.SimpleInvoker.invoke_process 
File "apache_beam/runners/common.py", line 1369, in apache_beam.runners.common._OutputProcessor.process_outputs 
File "/usr/local/lib/python3.7/site-packages/apache_beam/io/gcp/datastore/v1new/rampup_throttling_fn.py", line 83, in process max_ops_budget = self._calc_max_ops_budget(self._first_instant, instant) 
File "/usr/local/lib/python3.7/site-packages/apache_beam/io/gcp/datastore/v1new/rampup_throttling_fn.py", line 74, in _calc_max_ops_budget max_ops_budget = int(self._BASE_BUDGET / self._num_workers * (1.5**growth)) OverflowError: (34, 'Numerical result out of range') 

During handling of the above exception, another exception occurred: Traceback (most recent call last): 
File "/usr/local/lib/python3.7/site-packages/dataflow_worker/batchworker.py", line 651, in do_work work_executor.execute() 
File "/usr/local/lib/python3.7/site-packages/dataflow_worker/executor.py", line 213, in execute op.start() 
File "dataflow_worker/shuffle_operations.py", line 63, in "dataflow_worker/shuffle_operations.py", line 261, in 
...contd error message "apache_beam/runners/worker/operations.py", line 714, in apache_beam.runners.worker.operations.DoOperation.process 
File "apache_beam/runners/common.py", line 1235, in apache_beam.runners.common.DoFnRunner.process 
File "apache_beam/runners/common.py", line 1316, in apache_beam.runners.common.DoFnRunner._reraise_augmented 
File "apache_beam/runners/common.py", line 1233, in apache_beam.runners.common.DoFnRunner.process 
File "apache_beam/runners/common.py", line 571, in apache_beam.runners.common.SimpleInvoker.invoke_process 
File "apache_beam/runners/common.py", line 1369, in apache_beam.runners.common._OutputProcessor.process_outputs 
File "/usr/local/lib/python3.7/site-packages/apache_beam/io/gcp/datastore/v1new/rampup_throttling_fn.py", line 83, in process max_ops_budget = self._calc_max_ops_budget(self._first_instant, instant) 
File "/usr/local/lib/python3.7/site-packages/apache_beam/io/gcp/datastore/v1new/rampup_throttling_fn.py", line 74, in _calc_max_ops_budget max_ops_budget = int(self._BASE_BUDGET / self._num_workers * (1.5**growth)) 
RuntimeError: OverflowError: (34, 'Numerical result out of range') [while running 'Write to Data-store/Enforce throttling during ramp-up']

The jobs worked fine until now.

I checked the apache-beam python sdk updates added in release 2.32 for adding ramp-up to DatastoreIO connector [BEAM-12272] Python - Backport FirestoreIO connector's ramp-up to DatastoreIO connector - ASF JIRA

This introduces two new parameters for the connector throttle_rampup and hint_num_workers as described in apache_beam.io.gcp.datastore.v1new.datastoreio module — Apache Beam documentation

I have not made any changes to the parameter values. I need help in understanding what the parameters mean, particularly hint_num_workers and why is it failing with default values.

However setting the throttle_rampup=False the job runs fine. If I want to go with best practices and use throttle_rampup=True, how to do I make job run successfully.

Thanks in advance.

1 Answers

this is a know issue in the rampup_throttling_fn.py caused by the data type of the max_ops_budget variable, causing an overflow. You can see the issue report on beam GitHub. A fix was already merged to master. So, updating for a newer version should solve the issue (or downgrade for a version when its not available).

About the meaning of the parameters, there ins't much beyond the documentation description:

throttle_rampup – Whether to enforce a gradual ramp-up.

i.e, you have a number of workers that may increase due to the load, and this can be gradual or abrupt.

hint_num_workers – A hint for the expected number of workers, used to estimate appropriate limits during ramp-up throttling.

i.e the expected final number of workers, then the function can calculate how much workers can be created in a time slot to cause an gradual of abrupt effect on the ramp-up.

enter image description here

Related