Skip to content
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

Cleanup and asserts #130

Merged
merged 4 commits into from
Sep 10, 2023
Merged

Cleanup and asserts #130

merged 4 commits into from
Sep 10, 2023

Conversation

Ngalstyan4
Copy link
Contributor

No description provided.

@codecov
Copy link

codecov bot commented Sep 10, 2023

Codecov Report

Merging #130 (5f01084) into main (fe37327) will increase coverage by 0.69%.
The diff coverage is 87.17%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #130      +/-   ##
==========================================
+ Coverage   83.57%   84.27%   +0.69%     
==========================================
  Files          16       17       +1     
  Lines        1163     1170       +7     
  Branches      258      249       -9     
==========================================
+ Hits          972      986      +14     
+ Misses         81       79       -2     
+ Partials      110      105       -5     
Files Changed Coverage Δ
src/hnsw/options.c 86.66% <ø> (ø)
src/hooks/utils.c 100.00% <ø> (ø)
src/hnsw/utils.h 40.00% <40.00%> (ø)
src/hnsw/external_index.c 91.09% <86.66%> (+2.69%) ⬆️
src/hnsw/scan.c 81.37% <100.00%> (+1.96%) ⬆️
src/hooks/executor_start.c 89.47% <100.00%> (+0.58%) ⬆️
src/hooks/plan_tree_walker.c 68.75% <100.00%> (ø)
src/hooks/post_parse.c 95.38% <100.00%> (+0.07%) ⬆️

@github-actions
Copy link

github-actions bot commented Sep 10, 2023

Benchmarks

metric old new pct change
recall (after create) 0.740 0.740 0.00%
recall (after insert) 0.784 0.784 0.00%
select tps 3538.883 3940.240 11.34%
select latency (ms) 1.488 1.384 -6.99%
create latency (ms) 1565.723 1564.215 -0.10%
insert latency (ms) 1.711 1.757 2.69%
insert tps 584.390 569.150 -2.61%
disk usage (bytes) 6348800.000 6348800.000 0.00%

@var77
Copy link
Collaborator

var77 commented Sep 10, 2023

By this change, should we use ldb_invariant instead of elog(ERROR) in all places?

@Ngalstyan4 Ngalstyan4 force-pushed the narek/cleanup_and_asserts branch from c91f646 to 887e1c5 Compare September 10, 2023 08:18
@Ngalstyan4 Ngalstyan4 changed the title Narek/cleanup and asserts Cleanup and asserts Sep 10, 2023
@Ngalstyan4
Copy link
Contributor Author

No, some errors are expected and we can actually trigger them in tests.
Those should continue using elog directly

ldb_invariant is for invariants that hold no matter what and we can think of no way to trigger these.
The only reason I still elog from ldb_invariant is to get some hints on what went wrong, in case we do run into a broken invariant.

@dqii
Copy link
Contributor

dqii commented Sep 10, 2023

TODO: Add an invariant check to ldb_ get_operator_oids

@Ngalstyan4 Ngalstyan4 force-pushed the narek/cleanup_and_asserts branch 2 times, most recently from c0fa46b to 725c1b3 Compare September 10, 2023 20:53
@@ -55,7 +57,7 @@ bool plan_tree_walker(Plan *plan, bool (*walker_func)(Node *plan, void *context)
// Join nodes
case T_Join:
Join *join = (Join *)plan;
if(base_plan_walker(&(join->plan), walker_func, context)) return true;
if(base_plan_walker((Plan *)&(join->plan), walker_func, context)) return true;
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this or the one below should be necessary, join->plan is always a plan.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are right. removed it.

@Ngalstyan4 Ngalstyan4 force-pushed the narek/cleanup_and_asserts branch from e8c0651 to 6bbc630 Compare September 10, 2023 21:05
Per the standard:
https://port70.net/~nsz/c/c11/n1570.html#6.8.1

Labels must be followed by a statement.
Switch 'case's are just labels.
So, we cannot have a variable declaration right after a 'case'.
We *can* have a code block however, which is what this PR does.

It seems the newer compilers handle the case when a declaration comes
after a switch 'case'. But my compiler (gcc 10.2) complained about it
@Ngalstyan4 Ngalstyan4 force-pushed the narek/cleanup_and_asserts branch from fac194c to 5f01084 Compare September 10, 2023 22:03
@Ngalstyan4 Ngalstyan4 merged commit 865891d into main Sep 10, 2023
@Ngalstyan4 Ngalstyan4 deleted the narek/cleanup_and_asserts branch September 10, 2023 22:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants