Skip to content

Graph version #1382

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Nov 8, 2020
Merged

Graph version #1382

merged 11 commits into from
Nov 8, 2020

Conversation

swilly22
Copy link
Contributor

This PR will continue to fail as long as the new version of RedisGraph-py isn't deployed.
We introduce a Graph Version which "signs" the graph schema: (labels, relationship-types and attribute-set)
on each change to the graph "schema" the version is updated, client libraries taking advantage of the compact result-set format need to be in sync with the graph schema, they should update their internal mapping between labels, relationship-types and attribute-set strings to numeric IDs upon graph version change.

@swilly22 swilly22 added the bug label Oct 14, 2020
@swilly22 swilly22 self-assigned this Oct 14, 2020
Copy link
Contributor

@jeffreylovitz jeffreylovitz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like a sensible change to me. When I test locally with the graph-version redisgraph-py branch, I get 8 errors on queries that should have been cached executions reporting that they were uncached. Is that just me?

@lgtm-com
Copy link

lgtm-com bot commented Nov 5, 2020

This pull request introduces 1 alert when merging 9203e38 into 1bb7f20 - view on LGTM.com

new alerts:

  • 1 for Comparison result is always the same

Copy link
Contributor

@jeffreylovitz jeffreylovitz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking good to me, but it definitely merits documentation updates.

@@ -72,6 +72,7 @@ void Query_SetTimeOut(uint timeout, ExecutionPlan *plan) {
Cron_AddTask(timeout, QueryTimedOut, plan);
}


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unnecessary whitespace

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

if(!strcasecmp(arg, "--version")) {
int err = REDISMODULE_ERR;
if(i < argc - 1) {
i++; // Set the current argument to the timeout value.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"version value"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

*graph_version = v;
}

// Emit error on missing, negative, or non-numeric timeout values.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"version values"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

}

// Emit error on missing, negative, or non-numeric timeout values.
if(err != REDISMODULE_OK || *graph_version < 0) {
Copy link
Contributor

@jeffreylovitz jeffreylovitz Nov 5, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel this would be safer with an added check against v > UINT_MAX, we risk an integer overflow with the cast from long long to uint currently.

Also, since *graph_version is unsigned, that comparison always passes - this wouldn't be a problem with comparing against v.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

ASSERT(str != NULL);

/* Update graph version by hashing 'str' representing the current
* addition to the graph schema: (Label, Relationship-type, Attribute)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 This a clever solution.

@@ -175,6 +175,7 @@ static SIValue *Proc_BFS_Step(ProcedureCtx *ctx) {

UNUSED(res);
res = GxB_MatrixTupleIter_new(&iter, (GrB_Matrix)bfs_ctx->nodes);
UNUSED(res);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is unnecessary, dup of 176.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@lgtm-com
Copy link

lgtm-com bot commented Nov 5, 2020

This pull request introduces 1 alert when merging 3ff8500 into 1bb7f20 - view on LGTM.com

new alerts:

  • 1 for Comparison result is always the same

@swilly22 swilly22 merged commit ea87640 into master Nov 8, 2020
@swilly22 swilly22 deleted the graph-version branch November 8, 2020 14:00
swilly22 added a commit that referenced this pull request Nov 8, 2020
* added init time NodeScanCtx update on label scan (#1358)

* added init time NodeScanCtx update on label scan

* rephrase comment

Co-authored-by: Roi Lipman <[email protected]>

* Bfs procedure call (#1306)

* Import LAGraph files

* Apply autoformatter

* Add LAGraph include file

* WIP Add BFS procedure

* tmp Utility

* Revert LAGraph inclusions

* Replace LAGraph reference with GraphBLAS references

* WIP

* WIP

* Add BFSTree procedure

* Add unit tests

* Update documentation

* Resolve compiler warnings

* Address PR comments

* Make singular BFS procedure with variable outputs

* Remove start_node yield

* Address PR comments

* Remove yield-edges BFS input arg

* Address PR comments

* Switch to LAGraph_bfs_pushpull

* Remove unused code paths from LAGraph BFS algorithm

* procedure invocation receives yield array

* consume BFS result using iterator

* test BFS returning no results

* clean up, address PR comments

Co-authored-by: swilly22 <[email protected]>
Co-authored-by: Roi Lipman <[email protected]>

* Separate ExecutionPlan op construction logic into different files (#1352)

* Separate ExecutionPlan op construction logic into different files

* Address PR comments

* Refactor header files

* Address PR comments

Co-authored-by: Roi Lipman <[email protected]>

* Support array properties in bulk loader (#1365)

* Support array properties in bulk loader

* Address PR comments

* Add no_multi_key & hash_policy (#1363)

* Add no_multi_key & hash_policy

* Update ramp.yml

At the moment we can't handle user hash policy due to virtual keys

Co-authored-by: Roi Lipman <[email protected]>

* Add LGTM (#1367)

* read only query (#1364)

* read only query

* added sleep, try to avoid ci failure

* added more write scenarios. added replica shutdown

* added skip flag to avoid memcheck failure

* fixed PR comments

* Update module.c

* try to skip on any debugger. added more write scenarios

* checkSlaveSynced moved to use time.sleep. Another try to skip debuger

* added RO_QUERY to commands

Co-authored-by: Roi Lipman <[email protected]>

* Fix typo (#1368)

Co-authored-by: Roi Lipman <[email protected]>

* Add GRAPH.BULK documentation and link to bulk loader documentation (#1371)

* Add GRAPH.BULK documentation and link to bulk loader documentation

* Address PR comments

* Allow upper case letters in proc names (#1372)

* added to_lower for procedure name in Proc_get to support both upper and lower cases

* new test for lookup_case_insensitive

* Created strutil and moved the implementations of str_tolower and str_toupper to it. Remove the static implementations of these functions and replaced every call with a new call for str_tolower.
minor changes in getProc and procRegister due to PR

* fix indentations

* fix indentations

* minor changes

* minor changes

* indentations fix

* indentations fix

* indentations fix

* indentations fix

* indentations fix

* PR fixes

* PR fixes

* PR fixes

* PR fixes

* PR fixes

* PR fixes

* PR fixes

* PR fixes

Co-authored-by: Roi Lipman <[email protected]>

* Adding a new procedure that returns all the procedures in the system (#1377)

* Adding a new procedure that returns all the procedures in the system. This procedure may yield up to two fields for each procedure: its name and/or its mode (READ/WRITE).

* PR fixes

* Saving raxIterator reference instead of allocating it on the heap in proc_proceudres_private_data. More PR code fixes

* Remove the getter "Procedure_ReadOnly" that gets only the procedures name, leaving only the getter "Procedure_IsReadOnly" that gets the whole procedure object.

* Always set GraphCtx in QueryCtx while decoding graph keys (#1381)

* LGTM alert fixes (#1383)

Co-authored-by: Roi Lipman <[email protected]>

* Avoid double free of heap-allocated values in CASE...WHEN statements (#1386)

* Avoid double free of heap-allocated values in CASE...WHEN statements

* Update test_function_calls.py

Co-authored-by: Roi Lipman <[email protected]>

* With filter scoping (#1361)

* Don't migrate WITH filters into Merge and Apply scopes

* Don't place filters in previous scope for filtered aliases

* Fix memory error

* remove vector

* consolidate operation locating

* execution plan construction refactoring WIP

* move arithmetic expression construction from AST to AR_EXP

* discover skip, limit and black-listed ops modifiers

* PR fixes

* Fixes continued

* Fix ResultSet updates in UNION queries

* Clarify comments, minor cleanup

* Fix unit tests

* Fix caching logic for SKIP and LIMIT

* Address PR comments

* tidy up execution plan construction and join op

* reset limit on aggregation

* define 16 as the default batch size for traversal operations

Co-authored-by: swilly22 <[email protected]>
Co-authored-by: Roi Lipman <[email protected]>

* Updates to Astyle config file (#1384)

Co-authored-by: Roi Lipman <[email protected]>

* replace gitter with Discord (#1395)

* reaplace gitter with Discord

* replace gitter to discord

* Allow property accesses on non-identifier entity references (#1389)

* Allow property accesses on non-identifier entity references

* access entity attribute only via the property function

* address PR comments

Co-authored-by: swilly22 <[email protected]>
Co-authored-by: Roi Lipman <[email protected]>

* Minor suggested update. (#1398)

* replace automation service (#1399)

* redundent filter construction and placement (#1397)

* redundent filter construction and placement

* Add validating flow tests

Co-authored-by: Jeffrey Lovitz <[email protected]>

* Parse full argv array on main thread (#1298)

* Parse full argv array on main thread

* remove read_flags from cmd_query

Co-authored-by: Roi Lipman <[email protected]>
Co-authored-by: swilly22 <[email protected]>

* query validation should not check if procedure outputs been defined (#1406)

* query validation should not check if procedure outputs been defined

* address PR comments

* Add trusted-by logos (#1412)

* Add trusted-by logos

* add more logos

* Fuzzy test crashes (#1408)

* Correctly place filters without referenced variables

* Emit compile-time error on constant non-boolean filter

* Validate references per clause instead of per scope

* Emit error on failed filter placement in optimize_cartesian_product

* Fix free of invalid value in OpUnwind

* Handle NULL sources in variable-length traversals

* Address PR comments

* Post-rebase fixes

* Address PR comments

* introduce AST unsupported op error

Co-authored-by: swilly22 <[email protected]>

* Graph version (#1382)

* add graph version to graph context object

* change graph version from string to uint32

* testing graph version

* response with an error when graph version mismatch

* release graph context on version mismatch

* address PR comments

* increase command arity to accomadate graph version argument

* address PR comments

Co-authored-by: DvirDukhan <[email protected]>

* Release version 2.2.8. Merged from master.

Co-authored-by: DvirDukhan <[email protected]>
Co-authored-by: Roi Lipman <[email protected]>
Co-authored-by: Jeffrey Lovitz <[email protected]>
Co-authored-by: swilly22 <[email protected]>
Co-authored-by: Guy Korland <[email protected]>
Co-authored-by: Yahya <[email protected]>
Co-authored-by: Simon Prickett <[email protected]>
pnxguide pushed a commit to CMU-SPEED/RedisGraph that referenced this pull request Mar 22, 2023
* add graph version to graph context object

* change graph version from string to uint32

* testing graph version

* response with an error when graph version mismatch

* release graph context on version mismatch

* address PR comments

* increase command arity to accomadate graph version argument

* address PR comments

Co-authored-by: DvirDukhan <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants