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

issue-1146: enforce Clear() on all base classes for filestore transactions #2262

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

debnatkh
Copy link
Collaborator

@debnatkh debnatkh commented Oct 11, 2024

#2232 (comment)
References #1146


It is necessary to implement Clear() method for all transactions that is called upon unsuccessful PrepareTx() because such transactions are to be restarted and we expect to read new data from the database.

Earlier there transactions could be derived from TIndexStateNodeUpdates or TProfileAware that also implemented their custom Clear() methods and it was expected from the derived class to call Clear() of the base class in its Clear() method explicitly.

This leads to a possibility of forgetting to call Clear() of the base class in the derived class. In order to fix this problem a TClearEnforcer class is introduced. It is parameterized by the derived class and the base classes.

It enforces that all base classes have DoClear() method and they all are called before Derived::DoClear(). Also it is enforced, that no class but TClearEnforcer can call DoClear() method of TIndexStateNodeUpdates and TProfileAware classes.

@debnatkh debnatkh added the filestore Add this label to run only cloud/filestore build and tests on PR label Oct 11, 2024
@debnatkh debnatkh force-pushed the users/debnatkh/refactor-clear-in-tx branch 4 times, most recently from f25e4bc to 1a90988 Compare October 11, 2024 16:24
@debnatkh debnatkh changed the title issue-1146: enforce Clear() issue-1146: enforce Clear() on all base classes for filestore transactions Oct 11, 2024
@debnatkh debnatkh force-pushed the users/debnatkh/refactor-clear-in-tx branch from 1a90988 to 3cc5ef2 Compare October 11, 2024 16:39
@debnatkh debnatkh added the large-tests Launch large tests for PR label Oct 11, 2024
@debnatkh debnatkh force-pushed the users/debnatkh/refactor-clear-in-tx branch from 3cc5ef2 to 3c1ab02 Compare October 11, 2024 17:07
Copy link
Contributor

Note

This is an automated comment that will be appended during run.

🟢 linux-x86_64-relwithdebinfo: all tests PASSED for commit 3c1ab02.

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
1901 1901 0 0 0 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
filestore Add this label to run only cloud/filestore build and tests on PR large-tests Launch large tests for PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant