Fix resgroup unusable if its dropping failed
In function DropResourceGroup(), group->lockedForDrop is set
to true by calling ResGroupCheckForDrop, however, it can only
be set to false inside dropResgroupCallback. This callback is
registered at the ending of function DropResourceGroup. If an
error occured between them, group->lockedForDrop would be true
forever.
Fix it by putting the register process ahead of the lock call.
To prevent Assert(group->nRunning* > 0) if ResGroupCheckForDrop
throws an error, return directly if group->lockedForDrop did
not change.
See:
```
gpconfig -c gp_resource_manager -v group
gpstop -r -a
psql
CPU_RATE_LIMIT=20,
MEMORY_LIMIT=20,
CONCURRENCY=50,
MEMORY_SHARED_QUOTA=80,
MEMORY_SPILL_RATIO=20,
MEMORY_AUDITOR=vmtracker
);
psql -U user_test
> \d -- hang
```
Co-authored-by: Ndh-cloud <60729713+dh-cloud@users.noreply.github.com>
Showing
想要评论请 注册 或 登录