Hello everyone, I have a simple datastream job wi...
# troubleshooting
b
Hello everyone, I have a simple datastream job with a keyby followed by a keyedProcess function. with some state I have a keyspace the size of 6 Normally I'd set parallelism to the operator the size of my keyspace and everything is happy, no state collisions, etc... For some reason I can't get the subtasks to split evenly for this, the planner seems to combine two of the keys into the same subtask. This becomes problematic with output as I have two separate objects manipulating the same state. It's not until I set parallelism to 2x the keyspace that I see 6 separate subtasks become utilised. I do realize I can make the operator more "safe" by having one state per key in keyspace, but my understanding was this isn't required since keying the stream keeps state separated. Do I have a fundamental flaw in my grasp of keyed operators? ( quite possible 🙂 ) Is there a strategy folks are using to ensure keyspace is not shared?
FWIW I've also tried adding slot sharing groups to isolate the offending operator to no avail
p
Are you disabling chaining? It's important to remember Flink also uses parallelism to sink tasks. Perhaps you should define parallelism per operator and not per pipeline. Does it make sense?
b
Oddly enough, disabling chaining and or/matching sink parallelism doesn't affect the behavior described above.
Also tried a couple different custom partitioning strategies
p
For some reason I can't get the subtasks to split evenly for this, the planner seems to combine two of the keys into the same subtask.
Even if they get combined, the state should be keyed isolated. How are you managing your state? I think I misread this one at first.
I do realize I can make the operator more "safe" by having one state per key in keyspace, but my understanding was this isn't required since keying the stream keeps state separated.
This is the behavior indeed. Can you share what you have?