Skip to content

Simplify id space management #908

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

Merged
merged 12 commits into from
Jun 16, 2020
Merged

Simplify id space management #908

merged 12 commits into from
Jun 16, 2020

Conversation

tobim
Copy link
Member

@tobim tobim commented Jun 8, 2020

No description provided.

@tobim tobim added the refactoring Restructuring of existing code label Jun 8, 2020
@tobim tobim requested a review from a team June 8, 2020 14:51
@tobim tobim force-pushed the story/ch16628 branch 3 times, most recently from 3f28929 to 667af2a Compare June 12, 2020 13:20
@tobim tobim marked this pull request as ready for review June 12, 2020 13:21
available << '\n' << i->i << ' ' << i->last;
}
VAST_DEBUG(self, "saved", available_ids(), "available IDs");
std::ofstream available{to_string(dir / "next_id")};
Copy link
Member

Choose a reason for hiding this comment

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

Can you add a dir.is_writable() check above this line?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm against that. dir should always be a child of a vast.db folder, and that check should only be done for the parent.

Copy link
Member

Choose a reason for hiding this comment

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

The vast.db may already exist or be created by a system service, and the user may be using the wrong umask. I don't think we can make this assumption.

@dominiklohmann
Copy link
Member

I think we should remove the consensus module from the repo if it's essentially dead code now.

tobim added 10 commits June 15, 2020 11:03
This change decouples the importer from the consensus and lets
it manage the available ids independently.

That means that we won't be able to migrate partitions between
nodes any longer. However that is currently not an issue since
cluster mode is currently not implemented.
If a source wants to block until all its slices were consumed at
the index, it needs to subscribe to a flush notification. Before
this change, the importer would only forward this subscription to
the index if its own buffers were empty already, but not in the
other case.
@tobim
Copy link
Member Author

tobim commented Jun 15, 2020

@dominiklohmann do you mind taking another look at the latest commit. (The rest is only rebase.)

@dominiklohmann
Copy link
Member

dominiklohmann commented Jun 15, 2020

Looks fine from a taking a look at the code only. I'll check this out and run some tests locally.

Copy link
Member

@dominiklohmann dominiklohmann left a comment

Choose a reason for hiding this comment

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

This works really well in practice.

I think we should revert #906 as part of this PR. It's useful for monitoring whether this change works.

I've noticed a crash when setting table-slice-size to 0, which should probably get a nicer-looking error message instead.

@tobim
Copy link
Member Author

tobim commented Jun 15, 2020

I think we should revert #906 as part of this PR. It's useful for monitoring whether this change works.

I'd prefer not to, as the algorithm to build the JSON value is still extremely inefficient. (Will give problems with large archives regardless.)

I've noticed a crash when setting table-slice-size to 0, which should probably get a nicer-looking error message instead.

Will do.

Copy link
Member

@dominiklohmann dominiklohmann left a comment

Choose a reason for hiding this comment

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

Looks good to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactoring Restructuring of existing code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants