Skip to content

Misc bugs in utils. - #259

Merged
gsaluja9 merged 6 commits into
developfrom
fix/utils
Jul 25, 2023
Merged

gsaluja9 merged 6 commits into
developfrom
fix/utils

Conversation

@gsaluja9

Copy link
Copy Markdown
Contributor

No description provided.

Comment thread aperturedb/Utils.py Resolved
Comment thread aperturedb/Utils.py

try:
try:
for q in queries:

@luisremis luisremis Jul 20, 2023 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

the reason why this was a loop is because it was only practical to remove things on smaller transactions rather than 1 giant transaction. I think that is still the case, but we can try. @venkat-murty any thoughts?

In any case, I think this change is good because this is the end goal: a simple query and transaction that removes everything.
If we see that it is not practical to remove everything on a single transaction, we can implement something that deletes 10000 things at a time, check the schema, moves on the next 10000s, and iterate.

@bovlb

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

If we have enough memory then it should not be a problem. If we are deleting n objects then it will create in-memory n objects + an object for every connection + an object for all the connected nodes.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I would suggest limiting by some using limit = x, safer.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Another problem, a large delete can take a long time (so timeouts are possible) and you have no idea if the system is progressing.

In addition, we (should) would add time limits on queries for system stability in near future.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I would suggest limiting by some using limit = x, safer.

Yes, loops with a limit would be best, it can be in a followup PR too.

luisremis
luisremis previously approved these changes Jul 20, 2023
Comment thread test/run_test.sh Outdated
set -u
set -e
#set -u
#set -e

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think this change will make CI pass even after failure on tests.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thats true. The problem i was trying to address is that script should continue to upload aperturedb stuff to s3 even after failures in prev steps . I suppose I need to do a bash OR or something

Do you have a better idea?

@luisremis luisremis Jul 21, 2023 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nice, this reminded me I had the same issue. Here is how I solved it: https://github.com/aperture-data/athena/blob/develop/benchmarks/docker/scripts/start.sh#L49 (also, check the comment at the top of the file 🤣 )

Comment thread aperturedb/Utils.py
{"DeletePolygon": cmd},
{"DeleteFrame": cmd},
{"DeleteEntity": cmd},
{"GetSchema": {"refresh": True}}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@venkat-murty assuming all deletes worked, will GetSchema return the new schema after all the deletes?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Yes. If we have any delayed deletes (which we want for descriptors), get schema will return that descriptors exist.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ok, so we are good for now. Once we have delayed deletes, we revisit the best method for removing all objects.

luisremis
luisremis previously approved these changes Jul 21, 2023
Comment thread aperturedb/Utils.py
{"DeleteBoundingBox": cmd},
{"DeletePolygon": cmd},
{"DeleteFrame": cmd},
{"GetSchema": {"refresh": True}}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do we want to perhaps have the GetSchema run a a second command, outside of the transaction to verify afterwards?

Comment thread test/run_test.sh Outdated
echo "===================="
echo "Log file: $i"
echo "===================="
cat $i

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

if you use cat -n it will print the lines numbers

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

@luisremis luisremis left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🚀 thanks!

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.

4 participants