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

Small fixes for mac arm compilation and fix some tests #1905

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

maxim-morozov
Copy link

@maxim-morozov maxim-morozov commented Oct 9, 2024

Reference Issues/PRs

What does this implement or fix?

The fix for the compilation for MAC arm architecture that doesn't support __yield instruction. The fix also covers some unit test failures.

Any other comments?

Comments inline of the PR with explanations

Checklist

Checklist for code changes...
  • Have you updated the relevant docstrings, documentation and copyright notice?
  • Is this contribution tested against all ArcticDB's features?
  • Do all exceptions introduced raise appropriate error messages?
  • Are API changes highlighted in the PR description?
  • Is the PR labelled as enhancement or bug so it appears in autogenerated release notes?

Signed-Off By Maxim Morozov maxim.morozov@gmail.com. By including this sign-off line I agree to the terms of the Contributor License Agreement

@@ -256,12 +256,6 @@ inline KeyType get_key_type_for_index_stream(const StreamId &) {
return KeyType::TABLE_INDEX;
}

template <typename Function>
auto foreach_key_type(Function&& func) {
for(int k = 0; k < int(KeyType::UNDEFINED); ++k) {
Copy link
Author

Choose a reason for hiding this comment

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

It looks like the keytype = 0 is not used and also there is already a function to convert int to KeyType

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes, KeyTypes 1 and 2 were part of the original and now entirely superseded purpose or ArcticDB (as node storage for a specific graph strategy) and were never written anywhere.

@@ -133,9 +133,8 @@ class PrometheusInstance {
return;
}

metrics.erase({name, labels});
metrics_family.erase(it);
Copy link
Author

Choose a reason for hiding this comment

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

It looks like the remove operation also removes metrics-family though metrics-family might have additional metrics

// Create a Storage with 32KB map size
LMDBStorageFactory factory(32ULL * (1ULL << 10), false);
// Create a Storage with 64KB map size
LMDBStorageFactory factory(64ULL * (1ULL << 10), false);
Copy link
Author

Choose a reason for hiding this comment

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

In the M1 arm environment, the 32KB map throws a map-full exception on allocation. Looks like the minimum is 64KB.

@@ -14,7 +14,7 @@ namespace arcticdb {
#ifdef WIN32
#define PAUSE _mm_pause()
#elif defined(__arm__) || defined(__ARM_ARCH)
#define PAUSE __yield()
#define PAUSE asm volatile("yield")
Copy link
Author

Choose a reason for hiding this comment

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

__yield is not supported on Mac arm architecture.

@jamesmunro
Copy link
Collaborator

Hi @maxim-morozov . Please include the contributor sign-off in the commit message.

@maxim-morozov
Copy link
Author

Hi @maxim-morozov . Please include the contributor sign-off in the commit message.

Thanks @jamesmunro. I've included the contributor sign-off in the commit message as well.

…axim Morozov maxim.morozov@gmail.com. By including this sign-off line I agree to the terms of the Contributor License Agreement.
…m Morozov maxim.morozov@gmail.com. By including this sign-off line I agree to the terms of the Contributor License Agreement.
…im.morozov@gmail.com. By including this sign-off line I agree to the terms of the Contributor License Agreement
The new compatibility tests are in `tests/compat`.
This includes the following:
- `old_venv` fixture which allows executing some arctic commands frow
  within a custom venv.
- 2 compatibility tests. One of which showcases an issue with modifying
  library options of old environments.
- Tweak to the Build and Test workflow to run the compat tests only on
  newer python versions
Previously modifying a library option with a new version (>=v3.0.0)
would break old libraries (<v3.0.0)

This was because of the storage overrides introduced in v3.0.0.

This change moves the logic to modify a library option to C++
and it does the protobuf modification without applying a storage
override.

This makes storage overrides work well with both old libraries (as
demonstrated by now passing compatibility tests) and with new libraries
(as confirmed by test_arctic_library_management.py)
- Exposes a `read_unaltered_lib_cfg` method for the `LibraryTool`
- Uses it in compatibility modification test to verify that we only
  change the new fields
When destructing the mongo storage it was possible to destruct the api
instance before destructing the pool.

Moved the instance from the `MongoStorage` to the `MongoClient` to be
kept as a guard around the `mongocxx::pool`. `MongoStorage` didn't need
any sensitive mongocxx objects.

We also disable mongo tests for 4.5.0 as it contains the problematic
segfault.
All versions up to 4.5.0 have segfaults in lmdb destructor.
We skip lmdb backend compatibility tests for these versions to avoid
flaky tests.
The absolute paths were breaking some Azure conda-forge runners because
abspath was prefixing the path with `$SRC_DIR` which did not get
expanded on linux.
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