Skip to content

Commit fdc6dcc

Browse files
committed
Update QueryNode and QueryEdge protobuf construct handler read mode to avoid internal PMGD validation check exception
A read-write validation check is performed internally by PMGD. When running a query node/edge transaction with a readOnly flag a validation check will trigger an exception. The exception message will be propagated to the query response. This change allows the validation to pass while technically the transaction is still a readOnly operation. The validation occurs in the PMGD codebase, updating it is not reasonable at this time. Signed-off-by: Steven Rojas <[email protected]>
1 parent 30f7a45 commit fdc6dcc

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/PMGDQuery.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -676,6 +676,8 @@ void PMGDQuery::QueryNode(int ref, const std::string &tag,
676676
const Json::Value &constraints,
677677
const Json::Value &results, bool unique,
678678
bool intermediate_query) {
679+
_readonly = false;
680+
679681
PMGDCmd *cmdquery = new PMGDCmd();
680682
cmdquery->set_cmd_id(PMGDCmd::QueryNode);
681683
cmdquery->set_cmd_grp_id(_current_group_id);
@@ -713,6 +715,8 @@ void PMGDQuery::QueryEdge(int ref, int src_ref, int dest_ref,
713715
const std::string &tag,
714716
const Json::Value &constraints,
715717
const Json::Value &results, bool unique) {
718+
_readonly = false;
719+
716720
PMGDCmd *cmdquery = new PMGDCmd();
717721
cmdquery->set_cmd_id(PMGDCmd::QueryEdge);
718722
cmdquery->set_cmd_grp_id(_current_group_id);

0 commit comments

Comments
 (0)