-
Notifications
You must be signed in to change notification settings - Fork 229
Abort fork on intermediate states #2043
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2043 +/- ##
==========================================
+ Coverage 92.77% 92.83% +0.06%
==========================================
Files 247 248 +1
Lines 21648 21666 +18
==========================================
+ Hits 20084 20114 +30
+ Misses 1564 1552 -12
Continue to review full report at Codecov.
|
_ResetDecodeStates(); | ||
uint count = array_len(graphs_in_keyspace); | ||
for (size_t i = 0; i < count; i++) { | ||
GraphContext_Delete(graphs_in_keyspace[i]); |
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.
Can you please explain how the ref count
is managed in case where the original graph key is present in the key-space and when the original graph key is missing ?
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.
in that case when redis call the free function it supply the freed graph context
there is nothing to remove from registry and the refcount going to be decreased to -2 and to not free the graph context
@@ -34,7 +33,7 @@ static inline void _GraphContext_IncreaseRefCount(GraphContext *gc) { | |||
|
|||
static inline void _GraphContext_DecreaseRefCount(GraphContext *gc) { | |||
// If the reference count is less than 0, the graph has been marked for deletion and no queries are active - free the graph. | |||
if(__atomic_sub_fetch(&gc->ref_count, 1, __ATOMIC_RELAXED) < 0) { | |||
if(__atomic_sub_fetch(&gc->ref_count, 1, __ATOMIC_RELAXED) == -1) { |
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.
Should we add: ASSERT(gc->ref_count > -2);
?
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.
before or after?
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.
After
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.
I don't think so in our case we can get to -2 but want to call free once
src/commands/cmd_debug.c
Outdated
extern GraphContext **graphs_in_keyspace; | ||
extern uint aux_field_counter; | ||
|
||
static void Debug_AUX(const char *arg) { |
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.
pass original argv
and argc
you might want to pass argv+1, argc-1
as the first value AUX
was consumed.
|
||
self._connection_permutation(connection_permutation, 3) | ||
|
||
self._step(scenario[2], 3, None) |
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.
remove last argument, always None
@@ -16,7 +16,11 @@ void ModuleEventHandler_AUXAfterKeyspaceEvent(void); | |||
extern GraphContext **graphs_in_keyspace; | |||
extern uint aux_field_counter; | |||
|
|||
static void Debug_AUX(const char *arg) { | |||
static void Debug_AUX(RedisModuleString **argv, int argc) { | |||
if(argc < 2) return; |
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.
@AviAvni Emit an error in this case
@AviAvni Cherry pick into 2.4 |
* remove currently decoding graphs * removed AOF rewrite callback * abort encoding if intermediate graph detected * handle intermediate at the fork callback level * removed currently_decoding_graphs from graphcontext * add debug command * clear graphs_in_keyspace in flush all * add replication states tests * move exit to aux save * move exit to persistence event handler * address review * remove aux_field_counter * address review * address review Co-authored-by: swilly22 <[email protected]>
* Abort fork on intermediate states (#2043) * remove currently decoding graphs * removed AOF rewrite callback * abort encoding if intermediate graph detected * handle intermediate at the fork callback level * removed currently_decoding_graphs from graphcontext * add debug command * clear graphs_in_keyspace in flush all * add replication states tests * move exit to aux save * move exit to persistence event handler * address review * remove aux_field_counter * address review * address review Co-authored-by: swilly22 <[email protected]> * update keys Co-authored-by: swilly22 <[email protected]>
* remove currently decoding graphs * removed AOF rewrite callback * abort encoding if intermediate graph detected * handle intermediate at the fork callback level * removed currently_decoding_graphs from graphcontext * add debug command * clear graphs_in_keyspace in flush all * add replication states tests * move exit to aux save * move exit to persistence event handler * address review * remove aux_field_counter * address review * address review Co-authored-by: swilly22 <[email protected]> (cherry picked from commit ecd0552)
* Abort fork on intermediate states (#2043) * remove currently decoding graphs * removed AOF rewrite callback * abort encoding if intermediate graph detected * handle intermediate at the fork callback level * removed currently_decoding_graphs from graphcontext * add debug command * clear graphs_in_keyspace in flush all * add replication states tests * move exit to aux save * move exit to persistence event handler * address review * remove aux_field_counter * address review * address review Co-authored-by: swilly22 <[email protected]> (cherry picked from commit ecd0552) * bump version to 2.8.7 * Test against RE version 100.0.0-2646 Co-authored-by: Avi Avni <[email protected]>
* remove currently decoding graphs * removed AOF rewrite callback * abort encoding if intermediate graph detected * handle intermediate at the fork callback level * removed currently_decoding_graphs from graphcontext * add debug command * clear graphs_in_keyspace in flush all * add replication states tests * move exit to aux save * move exit to persistence event handler * address review * remove aux_field_counter * address review * address review Co-authored-by: swilly22 <[email protected]>
* index data on key load * remove index at end * index costruct both indices * Abort fork on intermediate states (#2043) * remove currently decoding graphs * removed AOF rewrite callback * abort encoding if intermediate graph detected * handle intermediate at the fork callback level * removed currently_decoding_graphs from graphcontext * add debug command * clear graphs_in_keyspace in flush all * add replication states tests * move exit to aux save * move exit to persistence event handler * address review * remove aux_field_counter * address review * address review Co-authored-by: swilly22 <[email protected]> * update keys * filter index scan result when index can't be utilize properly * fix test * handle reset * add more tests * make vkey_entity_count runtime config * address review * add tests * address review * fix test * address review Co-authored-by: Avi Avni <[email protected]>
* index data on key load * remove index at end * index costruct both indices * Abort fork on intermediate states (#2043) * remove currently decoding graphs * removed AOF rewrite callback * abort encoding if intermediate graph detected * handle intermediate at the fork callback level * removed currently_decoding_graphs from graphcontext * add debug command * clear graphs_in_keyspace in flush all * add replication states tests * move exit to aux save * move exit to persistence event handler * address review * remove aux_field_counter * address review * address review Co-authored-by: swilly22 <[email protected]> * update keys * filter index scan result when index can't be utilize properly * fix test * handle reset * add more tests * make vkey_entity_count runtime config * address review * add tests * address review * fix test * address review Co-authored-by: Avi Avni <[email protected]>
* Index on vkey (#2067) * index data on key load * remove index at end * index costruct both indices * Abort fork on intermediate states (#2043) * remove currently decoding graphs * removed AOF rewrite callback * abort encoding if intermediate graph detected * handle intermediate at the fork callback level * removed currently_decoding_graphs from graphcontext * add debug command * clear graphs_in_keyspace in flush all * add replication states tests * move exit to aux save * move exit to persistence event handler * address review * remove aux_field_counter * address review * address review Co-authored-by: swilly22 <[email protected]> * update keys * filter index scan result when index can't be utilize properly * fix test * handle reset * add more tests * make vkey_entity_count runtime config * address review * add tests * address review * fix test * address review Co-authored-by: Avi Avni <[email protected]> * fix merge * fix merge * fix merge * fix merge * fix merge * fix merge * fix merge * refine * address edge index scan review * fix checking the accuracy for index * order by index scan results * add comments * clean decode_graph * a bit more refactoring around encoder/decoder * address encoder/decoder review * clean * clean decode graph schema * address review * remove paren Co-authored-by: Roi Lipman <[email protected]> Co-authored-by: swilly22 <[email protected]>
* remove currently decoding graphs * removed AOF rewrite callback * abort encoding if intermediate graph detected * handle intermediate at the fork callback level * removed currently_decoding_graphs from graphcontext * add debug command * clear graphs_in_keyspace in flush all * add replication states tests * move exit to aux save * move exit to persistence event handler * address review * remove aux_field_counter * address review * address review Co-authored-by: swilly22 <[email protected]>
* Index on vkey (RedisGraph#2067) * index data on key load * remove index at end * index costruct both indices * Abort fork on intermediate states (RedisGraph#2043) * remove currently decoding graphs * removed AOF rewrite callback * abort encoding if intermediate graph detected * handle intermediate at the fork callback level * removed currently_decoding_graphs from graphcontext * add debug command * clear graphs_in_keyspace in flush all * add replication states tests * move exit to aux save * move exit to persistence event handler * address review * remove aux_field_counter * address review * address review Co-authored-by: swilly22 <[email protected]> * update keys * filter index scan result when index can't be utilize properly * fix test * handle reset * add more tests * make vkey_entity_count runtime config * address review * add tests * address review * fix test * address review Co-authored-by: Avi Avni <[email protected]> * fix merge * fix merge * fix merge * fix merge * fix merge * fix merge * fix merge * refine * address edge index scan review * fix checking the accuracy for index * order by index scan results * add comments * clean decode_graph * a bit more refactoring around encoder/decoder * address encoder/decoder review * clean * clean decode graph schema * address review * remove paren Co-authored-by: Roi Lipman <[email protected]> Co-authored-by: swilly22 <[email protected]>
No description provided.