Hi Sawada-san,
I agree with you on both A and B, and I would keep the current approach.
For A, a parallel worker gets its roleId in InitializeSessionUserId(),
so any reset has to come after that and the window stays. It also would
not cover the bgworker case.
I did not try B. I share your concern that it changes how DROP DATABASE
FORCE treats parallel workers today, which I would not want in a
backpatch.
Thanks,
Shihao