Hi,
The current logic of last query fuse the operation of getting query resource with the operation of querying actual data. This will lead to long time holding of the merge lock. However, merge lock should only be held during the operation of getting query resource. So we should separate the above two operations. The details can be seen in the attactment.
