aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_db_catree.h
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2018-10-18 11:29:06 +0200
committerSverker Eriksson <[email protected]>2018-10-23 12:36:29 +0200
commit77d3d262c5e7d784204a6d91b79ed2f46b4013ad (patch)
tree14a1b8f87c9ef617a966f95665e253af25a9e8ec /erts/emulator/beam/erl_db_catree.h
parent8cd07dae15569deea3a0b539057299a238c8ddc1 (diff)
downloadotp-77d3d262c5e7d784204a6d91b79ed2f46b4013ad.tar.gz
otp-77d3d262c5e7d784204a6d91b79ed2f46b4013ad.tar.bz2
otp-77d3d262c5e7d784204a6d91b79ed2f46b4013ad.zip
erts: Do contention adaptions during (updating) iterations
Once an iteration key has been found, never fall back to first/last key in next/prev tree as trees may split or join under our feet. I.e we must always use previous key when searching for the next key.
Diffstat (limited to 'erts/emulator/beam/erl_db_catree.h')
-rw-r--r--erts/emulator/beam/erl_db_catree.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/erts/emulator/beam/erl_db_catree.h b/erts/emulator/beam/erl_db_catree.h
index feb6f27980..6913609bf8 100644
--- a/erts/emulator/beam/erl_db_catree.h
+++ b/erts/emulator/beam/erl_db_catree.h
@@ -95,8 +95,11 @@ typedef struct db_table_catree {
typedef struct {
DbTableCATree* tb;
Eterm next_route_key;
- DbTableCATreeBaseNode* locked_bnode;
+ DbTableCATreeNode* locked_bnode;
+ DbTableCATreeNode* bnode_parent;
+ int bnode_level;
int read_only;
+ DbRouteKey* search_key;
} CATreeRootIterator;
@@ -109,9 +112,9 @@ TreeDbTerm** catree_find_root(Eterm key, CATreeRootIterator*);
TreeDbTerm** catree_find_next_from_pb_key_root(Eterm key, CATreeRootIterator*);
TreeDbTerm** catree_find_prev_from_pb_key_root(Eterm key, CATreeRootIterator*);
-TreeDbTerm** catree_find_nextprev_root(CATreeRootIterator*, int next);
-TreeDbTerm** catree_find_next_root(CATreeRootIterator*);
-TreeDbTerm** catree_find_prev_root(CATreeRootIterator*);
+TreeDbTerm** catree_find_nextprev_root(CATreeRootIterator*, int next, Eterm* keyp);
+TreeDbTerm** catree_find_next_root(CATreeRootIterator*, Eterm* keyp);
+TreeDbTerm** catree_find_prev_root(CATreeRootIterator*, Eterm* keyp);
TreeDbTerm** catree_find_first_root(CATreeRootIterator*);
TreeDbTerm** catree_find_last_root(CATreeRootIterator*);