8000 store: deprecate GCCount column by mina86 · Pull Request #7632 · near/nearcore · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

store: deprecate GCCount column #7632

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 1 commit into from
Sep 19, 2022
Merged

store: deprecate GCCount column #7632

merged 1 commit into from
Sep 19, 2022

Conversation

mina86
Copy link
Contributor
@mina86 mina86 commented Sep 18, 2022

We’re writing to the GCCount column but never read from it in
production. It’s only ever used in store validator but even there zero
values in garbage-collected columns results in the column being
printed at the end of the validation rather than any kind of failure.
So really, I’d argue the column doesn’t serve any purpose.

Removing the column not only simplifies the code but also allows us to
get rid of borsh serialisation of the DBCol enum. This in turn means
that now the variants in the enum can be rearranged or deleted without
breaking things.

Note that I’m not clearing out this column in this commit. I’m
planning to introduce an unrelated database migration soon and will do
the clearing then.

We’re writing to the GCCount column but never read from it in production.
It’s only ever used in store validator but even there zero values in
garbage-collected columns results in the column being printed at the end
of the validation rather than any kind of failure.  So really, I’d argue
the column doesn’t serve any purpose.

Removing the column not only simplifies the code but also allows us to get
rid of borsh serialisation of the DBCol enum.  This in turn means that now
the variants in the enum can be rearranged or deleted without breaking
things.

Note that I’m not clearing out this column in this commit.  I’m planning to
introduce an unrelated database migration soon and will do the clearing
then.
@mina86 mina86 added P-low Priority: low S-automerge labels Sep 18, 2022
@mina86 mina86 requested a review from a team as a code owner September 18, 2022 16:44
@mina86 mina86 requested a review from akhi3030 September 18, 2022 16:44
Copy link
Contributor
@matklad matklad left a comment

Choose a reason for hiding this comment

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

LGTM!

One question here is whether we need a metric here, and my feeling is that we don't. We generally keep an eye on storage usage, so we'll notice if something goes significantly wrong. And for figuring out what exactly is wrong I'd say just inspecting the database directly would be more fruitful.

@@ -2327,7 +2312,8 @@ impl<'a> ChainStoreUpdate<'a> {
store_update.delete(col, key);
}
DBCol::BlockHeader => {
// TODO #3488
// TODO(#3488) At the moment header sync needs block headers.
Copy link
Contributor

Choose a reason for hiding this comment

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

❤️

@near-bulldozer near-bulldozer bot merged commit bb978a4 into near:master Sep 19, 2022
@mina86 mina86 deleted the f branch September 19, 2022 09:30
nikurt pushed a commit that referenced this pull request Nov 9, 2022
We’re writing to the GCCount column but never read from it in
production. It’s only ever used in store validator but even there zero
values in garbage-collected columns results in the column being
printed at the end of the validation rather than any kind of failure.
So really, I’d argue the column doesn’t serve any purpose.

Removing the column not only simplifies the code but also allows us to
get rid of borsh serialisation of the DBCol enum.  This in turn means
that now the variants in the enum can be rearranged or deleted without
breaking things.

Note that I’m not clearing out this column in this commit.  I’m
planning to introduce an unrelated database migration soon and will do
the clearing then.
@HarishankarVj12
Copy link

Let me know the rust and cargo version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P-low Priority: low
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0