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

fix: avoid any updates after table is closed #998

Merged
merged 2 commits into from
Jun 19, 2023

Conversation

ShiKaiWi
Copy link
Member

@ShiKaiWi ShiKaiWi commented Jun 16, 2023

Rationale

Part of #990.

Some background jobs are still allowed to execute, and it will lead to data corrupted when a table is migrated between different nodes because of multiple writers for the same table.

Detailed Changes

Introduce a flag called invalid in the table data to denote whether the serial executor is valid, and this flag is protected with the TableOpSerialExecutor in table data, and the TableOpSerialExecutor won't be acquired if the flag is set, that is to say, any table operation including updating manifest, altering table and so on, can't be executed after the flag is set because these operations require the TableOpSerialExecutor. Finally, the flag will be set when the table is closed.

@ShiKaiWi ShiKaiWi requested a review from Rachelint June 16, 2023 09:55
analytic_engine/src/instance/close.rs Show resolved Hide resolved
analytic_engine/src/instance/close.rs Outdated Show resolved Hide resolved
analytic_engine/src/table/data.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@Rachelint Rachelint left a comment

Choose a reason for hiding this comment

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

LGTM

@Rachelint Rachelint merged commit 85eb0b7 into apache:main Jun 19, 2023
@ShiKaiWi ShiKaiWi deleted the fix-mark-table-close branch June 19, 2023 11:59
MichaelLeeHZ pushed a commit to MichaelLeeHZ/ceresdb that referenced this pull request Jun 21, 2023
Part of apache#990.

Some background jobs are still allowed to execute, and it will lead to
data corrupted when a table is migrated between different nodes because
of multiple writers for the same table.

Introduce a flag called `invalid` in the table data to denote whether
the serial executor is valid, and this flag is protected with the
`TableOpSerialExecutor` in table data, and the `TableOpSerialExecutor`
won't be acquired if the flag is set, that is to say, any table
operation including updating manifest, altering table and so on, can't
be executed after the flag is set because these operations require the
`TableOpSerialExecutor`. Finally, the flag will be set when the table is
closed.
ShiKaiWi added a commit to ShiKaiWi/ceresdb that referenced this pull request Jun 26, 2023
ShiKaiWi added a commit that referenced this pull request Jun 26, 2023
This reverts commit 85eb0b7.

## Rationale
The changes introduced by #998 are not reasonable. Another fix will
address #990.

## Detailed Changes
Revert #998
dust1 pushed a commit to dust1/ceresdb that referenced this pull request Aug 9, 2023
## Rationale
Part of apache#990.

Some background jobs are still allowed to execute, and it will lead to
data corrupted when a table is migrated between different nodes because
of multiple writers for the same table.

## Detailed Changes
Introduce a flag called `invalid` in the table data to denote whether
the serial executor is valid, and this flag is protected with the
`TableOpSerialExecutor` in table data, and the `TableOpSerialExecutor`
won't be acquired if the flag is set, that is to say, any table
operation including updating manifest, altering table and so on, can't
be executed after the flag is set because these operations require the
`TableOpSerialExecutor`. Finally, the flag will be set when the table is
closed.
dust1 pushed a commit to dust1/ceresdb that referenced this pull request Aug 9, 2023
…pache#1034)

This reverts commit 85eb0b7.

## Rationale
The changes introduced by apache#998 are not reasonable. Another fix will
address apache#990.

## Detailed Changes
Revert apache#998
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.

3 participants