server: Open read storage txn in query api handler
server: Open read storage txn in query api handler

Currently a write transaction on the store is opened
inside the query API handler (ie. v1DataPost). What this
means is if the user wants to evaluate a policy while
OPA is activating a bundle, the api request would block
trying to open a write txn on the store till the bundle
was activated. If OPA is activating a large bundle,
the write lock is held longer and hence the client would
notice the latency in OPA's API response. This change updates
the query handler to open a read txn on the store which was
the case pre-v0.39.0.

Signed-off-by: Ashutosh Narkar <334e9094b46d3151817f829cebfa78d0453b0333@gmail.com>

open-policy-agent/opa,open-policy-agent/opa,open-policy-agent/opa,open-policy-agent/opa,open-policy-agent/opa,open-policy-agent/opa