-
Notifications
You must be signed in to change notification settings - Fork 19
Tree inserts: prefer read lock than write lock #122
Tree inserts: prefer read lock than write lock #122
Conversation
Reviewed 3 of 6 files at r1. src/pmse_index_cursor.cpp, line 70 at r1 (raw file):
Scope of variables should be reduced src/pmse_index_cursor.cpp, line 72 at r1 (raw file):
Unnecessary parentheses src/pmse_index_cursor.cpp, line 78 at r1 (raw file):
Should be swapped with IndexKeyEntry for better code understanding:
src/pmse_index_cursor.cpp, line 90 at r1 (raw file):
Unnecessary parentheses src/pmse_index_cursor.cpp, line 104 at r1 (raw file):
Obfuscating indentation, should be in else block src/pmse_index_cursor.cpp, line 116 at r1 (raw file):
To one line, remove parentheses src/pmse_index_cursor.cpp, line 118 at r1 (raw file):
Related issue: #118 src/pmse_index_cursor.cpp, line 160 at r1 (raw file): Consider:
versus
What's the difference? src/pmse_index_cursor.cpp, line 323 at r1 (raw file):
no need tu put spaces between * and type src/pmse_index_cursor.cpp, line 329 at r1 (raw file):
missing spaces between } ( etc. src/pmse_index_cursor.h, line 102 at r1 (raw file):
Only declared src/pmse_index_cursor.h, line 120 at r1 (raw file): Quoted 4 lines of code…> const bool _unique; > CursorObject _returnValue; > static IndexKeyEntry_PM min; > static IndexKeyEntry_PM max;Not used src/pmse_index_cursor.h, line 122 at r1 (raw file):
Structure wrapping IndexKeyEntry without any reason src/pmse_index_cursor.h, line 131 at r1 (raw file):
Not used variable src/pmse_tree.cpp, line 508 at r1 (raw file):
Why not: return nullptr? src/pmse_tree.cpp, line 511 at r1 (raw file):
Parentheses src/pmse_tree.cpp, line 512 at r1 (raw file):
spaces after if, brackets in the same line src/pmse_tree.cpp, line 517 at r1 (raw file):
? src/pmse_tree.cpp, line 523 at r1 (raw file):
Equality operator is overloaded for persistent_ptr<> src/pmse_tree.cpp, line 550 at r1 (raw file):
This block should be rewrote src/pmse_tree.cpp, line 568 at r1 (raw file):
return nullptr; src/pmse_tree.cpp, line 570 at r1 (raw file):
Code duplication with line 529 src/pmse_tree.cpp, line 919 at r1 (raw file):
remove empty line Comments from Reviewable |
Reviewed 3 of 6 files at r1. Comments from Reviewable |
Review status: all files reviewed at latest revision, 23 unresolved discussions. src/pmse_index_cursor.cpp, line 70 at r1 (raw file): Previously, KFilipek (Krzysztof Filipek) wrote…
If you mean scope, then it is OK. It is local variable. src/pmse_index_cursor.cpp, line 72 at r1 (raw file):
src/pmse_index_cursor.cpp, line 78 at r1 (raw file): Previously, KFilipek (Krzysztof Filipek) wrote…
Looks the same for me. src/pmse_index_cursor.cpp, line 90 at r1 (raw file): Previously, KFilipek (Krzysztof Filipek) wrote…
Parenthesis here simplify my understanding whole behavior src/pmse_index_cursor.cpp, line 104 at r1 (raw file): Previously, KFilipek (Krzysztof Filipek) wrote…
OK, but return was just line above. src/pmse_index_cursor.cpp, line 116 at r1 (raw file): Previously, KFilipek (Krzysztof Filipek) wrote…
Parenthesis here simplify my understanding whole behavior src/pmse_tree.cpp, line 511 at r1 (raw file): Previously, KFilipek (Krzysztof Filipek) wrote…
Parenthesis here simplify my understanding whole behavior src/pmse_tree.cpp, line 517 at r1 (raw file): Previously, KFilipek (Krzysztof Filipek) wrote…
? src/pmse_tree.cpp, line 550 at r1 (raw file): Previously, KFilipek (Krzysztof Filipek) wrote…
Tree split won't happen more than 2 times. Comments from Reviewable |
Review status: all files reviewed at latest revision, 23 unresolved discussions. src/pmse_index_cursor.h, line 122 at r1 (raw file): Previously, KFilipek (Krzysztof Filipek) wrote…
Query is used in many places. Check also similar definition in other engines. Comments from Reviewable |
Reviewed 1 of 3 files at r2. src/pmse_index_cursor.h, line 122 at r1 (raw file):
do the job.
is changed to:
and: src/pmse_tree.cpp, line 517 at r1 (raw file): Previously, jschmieg wrote…
} else { src/pmse_tree.cpp, line 550 at r1 (raw file): Previously, jschmieg wrote…
so: Comments from Reviewable |
Review status: 3 of 6 files reviewed at latest revision, 23 unresolved discussions, some commit checks failed. src/pmse_tree.cpp, line 550 at r1 (raw file): Previously, KFilipek (Krzysztof Filipek) wrote…
not 2 but 0,1 or 2. Comments from Reviewable |
2520e18
to
b51d95a
Compare
Review status: 3 of 6 files reviewed at latest revision, 23 unresolved discussions. src/pmse_index_cursor.cpp, line 72 at r1 (raw file): Previously, jschmieg wrote…
Done. src/pmse_index_cursor.cpp, line 78 at r1 (raw file): Previously, jschmieg wrote…
Done. src/pmse_index_cursor.cpp, line 90 at r1 (raw file): Previously, jschmieg wrote…
Done. src/pmse_index_cursor.cpp, line 104 at r1 (raw file): Previously, jschmieg wrote…
Done. src/pmse_index_cursor.cpp, line 323 at r1 (raw file): Previously, KFilipek (Krzysztof Filipek) wrote…
Done. src/pmse_index_cursor.cpp, line 329 at r1 (raw file): Previously, KFilipek (Krzysztof Filipek) wrote…
Done. src/pmse_index_cursor.h, line 102 at r1 (raw file): Previously, KFilipek (Krzysztof Filipek) wrote…
? src/pmse_index_cursor.h, line 120 at r1 (raw file): Previously, KFilipek (Krzysztof Filipek) wrote…
Done. src/pmse_index_cursor.h, line 122 at r1 (raw file): Previously, KFilipek (Krzysztof Filipek) wrote…
Done. src/pmse_index_cursor.h, line 131 at r1 (raw file): Previously, KFilipek (Krzysztof Filipek) wrote…
Done. src/pmse_tree.cpp, line 508 at r1 (raw file): Previously, KFilipek (Krzysztof Filipek) wrote…
Done. src/pmse_tree.cpp, line 511 at r1 (raw file): Previously, jschmieg wrote…
Done. src/pmse_tree.cpp, line 512 at r1 (raw file): Previously, KFilipek (Krzysztof Filipek) wrote…
Done. src/pmse_tree.cpp, line 517 at r1 (raw file): Previously, KFilipek (Krzysztof Filipek) wrote…
Done. src/pmse_tree.cpp, line 550 at r1 (raw file): Previously, jschmieg wrote…
Done. src/pmse_tree.cpp, line 568 at r1 (raw file): Previously, KFilipek (Krzysztof Filipek) wrote…
Done. src/pmse_tree.cpp, line 919 at r1 (raw file): Previously, KFilipek (Krzysztof Filipek) wrote…
Done. Comments from Reviewable |
Review status: 2 of 6 files reviewed at latest revision, 23 unresolved discussions. src/pmse_tree.cpp, line 523 at r1 (raw file): Previously, KFilipek (Krzysztof Filipek) wrote…
Done. Comments from Reviewable |
Review status: 2 of 6 files reviewed at latest revision, 23 unresolved discussions. src/pmse_index_cursor.cpp, line 118 at r1 (raw file): Previously, KFilipek (Krzysztof Filipek) wrote…
created US. src/pmse_index_cursor.cpp, line 160 at r1 (raw file): Previously, KFilipek (Krzysztof Filipek) wrote…
created US src/pmse_tree.cpp, line 570 at r1 (raw file): Previously, KFilipek (Krzysztof Filipek) wrote…
created US. Comments from Reviewable |
Reviewed 2 of 6 files at r1, 4 of 4 files at r5. Comments from Reviewable |
Reviewed 1 of 2 files at r3, 3 of 4 files at r5. Comments from Reviewable |
709946e
to
0b1dc97
Compare
Modification in tree locking algorithm during inserts and reads. This algorithm prefers read-locks and then write-lock for inserts.
This change is