-
Notifications
You must be signed in to change notification settings - Fork 230
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
Lock on write proc #1573
Lock on write proc #1573
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Looks good! A few small comments.
src/schema/schema.c
Outdated
@@ -85,34 +85,47 @@ int Schema_AddIndex(Index **idx, Schema *s, const char *field, IndexType type) { | |||
return INDEX_OK; | |||
} | |||
|
|||
int Schema_RemoveIndex(Schema *s, const char *field, IndexType type) { | |||
static int _schema_RemoveExactMatchIndex(Schema *s, const char *field) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit - _Schema_RemoveExactMatchIndex
src/schema/schema.c
Outdated
} | ||
|
||
return INDEX_OK; | ||
} | ||
|
||
static int _schema_RemoveFullTextIndex(Schema *s) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit - _Schema_RemoveFullTextIndex
ResultSet_IndexDeleted(result_set, res); | ||
Schema *s = GraphContext_GetSchema(gc, label, SCHEMA_NODE); | ||
|
||
if(s != NULL) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch!
if(GraphContext_AddIndex(&idx, gc, label, field, IDX_FULLTEXT) == INDEX_OK) { | ||
res = INDEX_OK; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
res = GraphContext_AddIndex(&idx, gc, label, field, IDX_FULLTEXT);
if(res != INDEX_OK) break;
FWIW the older approach had the benefit of resolving the schema only once, but I don't mind this change if you think it's a better abstraction.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not only abstraction, but this way will make sure the statistics are updated, we can't break here as there might be several fields being added out of which some might already exists. we want to construct only if the user presented a new field
eb55359
to
baeea0f
Compare
* write lock when invoking write procedure * replicate index modifications
* Avoid postponed array (#1569) * WIP * persist projected values * remove emit record * Lock on write proc (#1573) * write lock when invoking write procedure * replicate index modifications * Use file streaming endpoint to parse queries (#1572) * Use file streaming endpoint to parse queries * Revert change to default parse buffer size * Address PR comments Co-authored-by: Roi Lipman <swilly22@users.noreply.github.com> Co-authored-by: Jeffrey Lovitz <jeffrey.lovitz@gmail.com>
* write lock when invoking write procedure * replicate index modifications
Resolves #1570