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

Make all modification methods respect prune_previous_versions #1556

Merged
merged 1 commit into from May 17, 2024

Conversation

phoebusm
Copy link
Collaborator

@phoebusm phoebusm commented May 8, 2024

Reference Issues/PRs

#711

What does this implement or fix?

Add prune_previous option to APIs which still don't support it

Any other comments?

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?

@phoebusm phoebusm self-assigned this May 8, 2024
@phoebusm phoebusm linked an issue May 8, 2024 that may be closed by this pull request
2 tasks
@phoebusm phoebusm marked this pull request as ready for review May 8, 2024 21:50
@@ -194,7 +194,7 @@ TEST_F(VersionStoreTest, SortMerge) {
test_store_->append_incomplete_frame(symbol, std::move(frame.input_frame_));
}

test_store_->sort_merge_internal(symbol, std::nullopt, true, false, false, false);
test_store_->sort_merge_internal(symbol, std::nullopt, true, false, false, false, false);
Copy link
Collaborator

Choose a reason for hiding this comment

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

5 bools in a row isn't a good API (nor was 4 before your change!). Refactor by pulling out a struct for the options?

@@ -81,7 +81,8 @@ class LocalVersionedEngine : public VersionedEngine {
VersionedItem delete_range_internal(
const StreamId& stream_id,
const UpdateQuery& query,
bool dynamic_schema) override;
bool dynamic_schema,
bool prune_previous_versions) override;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Too many bools - pull out a struct for the options?

cpp/arcticdb/version/version_store_api.hpp Outdated Show resolved Hide resolved
@@ -238,6 +238,26 @@ def arctic_library(arctic_client, lib_name):
return arctic_client.create_library(lib_name)


@pytest.fixture(
scope="function",
params=[
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why is this parameterized? Isn't just LMDB fine? Isn't there a similar fixture already?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I was trying to create a library fixture similar to existing def basic_store()
It is used by test_write_parallel_sort_merge which tests parallelism. So I think it's safer to test multiple storages.

@@ -540,6 +540,37 @@ def test_delete_date_range_with_strings(version_store_factory, index_start):
assert_frame_equal(vit.data, df)


@pytest.mark.parametrize("prune_previous_versions", [True, False])
Copy link
Collaborator

Choose a reason for hiding this comment

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

Most of this test is the same as the one above it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes but I don't want to make def test_delete_date_range_with_strings more complicated.
And I only need to test against lmdb

@@ -49,6 +49,14 @@ struct KeySizesInfo {
size_t uncompressed_size; // bytes
};

struct SortMergeOptiona {
Copy link
Collaborator

Choose a reason for hiding this comment

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

typo - should be SortMergeOptions

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

😿

@phoebusm phoebusm force-pushed the feature/add_prune_previous branch from 39b402b to c4f0e4f Compare May 16, 2024 15:52
@phoebusm phoebusm merged commit b0f953c into master May 17, 2024
114 checks passed
@phoebusm phoebusm deleted the feature/add_prune_previous branch May 17, 2024 09:59
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.

Make all modification methods respect prune_previous_versions
2 participants