-
Notifications
You must be signed in to change notification settings - Fork 444
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
admin fate
improvements, LockID
s use for fate stores improved/fixed
#5028
base: main
Are you sure you want to change the base?
Conversation
This commit makes several improvements/fixes: improvements to the `admin fate` util which were made possible from apache#4524, replaced incorrect use of `createDummyLockID()` in real code (now only used in tests), `<User/Meta>FateStore` now support a null lock id if they will be used as read-only stores: write ops will fail on a store with a null lock, and some other misc. changes. Full list of changes: - Removed the check for a dead Manager in the Admin fate util (AdminUtil) which was checked before `admin fate delete <tx>` or `admin fate fail <tx>` was able to run. This check is no longer needed with the changes from apache#4524. apache#4524 moved reservations out of Manager memory into the FATE table (for UserFateStore) and into ZK (for MetaFateStore). Prior to this, the Admin process would have no way of knowing if the Manager process had a transaction reserved, so the Manager had to be shutdown to ensure it was not. But now that reservations are visible to any process, we can try to reserve the transaction in Admin, and if it cannot be reserved and deleted/failed in a reasonable time, we let the user know that the Manager would need to be shutdown if deleting/failing the transaction is still desired. - This has several benefits: - It is one less thing to worry about when implementing multiple managers in the future since Admin assumes only one Manager for these commands. However, there is still the case where the Manager may keep a transaction reserved for a long period of time and the Admin can never reserve it. In this case, we inform the user that the transaction could not be deleted/failed and that if deleting/failing is still desired, the Manager may need to be shutdown. - It covers a potential issue in the previously existing code where there was nothing stopping or ensuring a Manager is not started after the check is already performed in Admin but before the delete/ fail was executed. - It also should make the commands easier to use now since the Manager is not required to be shutdown before use. - Changes and adds some tests for `admin fate fail` and `admin fate delete`: ensures the Manager is not required to be down to fail/delete a transaction, and ensures that if the Manager does have a transaction reserved, admin will fail to reserve and fail/delete the transaction. - Another change which was needed as a prerequisite for the above changes was creating a ZK lock for Admin so transactions can be properly reserved by the command. Added new constant `Constants.ZADMIN_LOCK = "/admin/lock"`, changed `ServiceLockPaths`, and added `Admin.createAdminLock()` to support this - New class `TestLock` (in test package) which is used by tests to create a real ZK lock, or a dummy one. Removed `createDummyLockID()` from `AbstractFateStore` (moved to TestLock), and `createDummyLock()` is now only used in test code. Added new constant `ZTEST_LOCK = "/test/lock"`, changed `ServiceLockPaths`, and added `createTestLock()` which is used to create a real lock id (one held in ZK) which is needed for some tests. - This fixes an unexpected failure that could have occurred for `ExternalCompaction_1_IT`. Was using a dummy lock for the store before and the fate data was being stored in the same locations that the Manager uses for it's fate data. The DeadReservationCleaner running in Manager would have cleaned up reservations created using this store if it ran when reservations were present. Now the test creates a real ZK lock so the DeadReservationCleaner won't clean these up unexpectedly. - Stores now support a null lock id for the situation where they will be used as read-only stores. A store with a null lock id will fail on write ops. Changed all existing uses of stores to only have a lock id if writes will occur (previously, all instances of the stores had a lock id). - Removed unused or unneccesary constructors for AbstractFateStore, MetaFateStore, UserFateStore - Ensured all tests changed, all FATE tests, and sunny day tests still pass closes apache#4904
server/base/src/main/java/org/apache/accumulo/server/util/Admin.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These changes look good, made some minor comments but did not see problems.
core/src/main/java/org/apache/accumulo/core/fate/AdminUtil.java
Outdated
Show resolved
Hide resolved
server/base/src/main/java/org/apache/accumulo/server/util/Admin.java
Outdated
Show resolved
Hide resolved
server/base/src/main/java/org/apache/accumulo/server/util/Admin.java
Outdated
Show resolved
Hide resolved
server/base/src/main/java/org/apache/accumulo/server/util/Admin.java
Outdated
Show resolved
Hide resolved
server/base/src/main/java/org/apache/accumulo/server/util/Admin.java
Outdated
Show resolved
Hide resolved
server/base/src/main/java/org/apache/accumulo/server/util/Admin.java
Outdated
Show resolved
Hide resolved
test/src/main/java/org/apache/accumulo/test/fate/FateOpsCommandsIT.java
Outdated
Show resolved
Hide resolved
One thing I noticed when working on this and running the tests again was that in a couple of the new tests added here ( |
I tried running these test and did not see a problem. I saw an unrelated problem and made a comment about that. If I could see the problem I think I would try to jstack the process and see what the thread was doing. |
@keith-turner - I don't see the problem/comment you are referring to. I did notice the exit status when Admin loses the lock caused some test failures (noticed when resolving conflicts), so I fixed that in 8cc7b39 I'm going to try to figure out the worker issue with your jstack suggestion. |
So, I was testing this yesterday, and was able to reproduce the same issue running
And this is seen again with this repeatedly printed (statement printed from
I tried to reproduce again today with some debugging statements to better figure out why the worker would still be running, but after many, many attempts, I did not see the same failure again. Without being able to consistently reproduce the bug and without understanding based on the code how this could be occurring, I'm out of ideas and things to do to figure this out. I'm not sure if this is a bug with my testing logic for the tests where I have seen this bug ( Anyways, I'm out of things to try. Whenever you get the chance @keith-turner maybe you could look at the test logic, |
One thing I am considering is maybe this order of shutdown in
work finder is interrupted after the workers are shutdown... I think it makes more sense to interrupt the work finder then shutdown the worker pool |
This PR makes several improvements/fixes: improvements to the
admin fate
util which were made possible from #4524, replaced incorrect use ofcreateDummyLockID()
in real code (now only used in tests),<User/Meta>FateStore
now support a null lock id if they will be used as read-only stores: write ops will fail on a store with a null lock, and some other misc. changes.Full list of changes:
admin fate delete <tx>
oradmin fate fail <tx>
was able to run. This check is no longer needed with the changes from Fate reservations moved out of memory #4524. Fate reservations moved out of memory #4524 moved reservations out of Manager memory into the FATE table (for UserFateStore) and into ZK (for MetaFateStore). Prior to this, the Admin process would have no way of knowing if the Manager process had a transaction reserved, so the Manager had to be shutdown to ensure it was not. But now that reservations are visible to any process, we can try to reserve the transaction in Admin, and if it cannot be reserved and deleted/failed in a reasonable time, we let the user know that the Manager would need to be shutdown if deleting/failing the transaction is still desired.keep a transaction reserved for a long period of time and the Admin can never reserve it. In this case, we inform the user that the transaction could not be deleted/failed and that if deleting/failing
is still desired, the Manager may need to be shutdown.
fail was executed.
admin fate fail
andadmin fate delete
: ensures the Manager is not required to be down to fail/delete a transaction, and ensures that if the Manager does have a transaction reserved, admin will fail to reserve and fail/delete the transaction.Constants.ZADMIN_LOCK = "/admin/lock"
, changedServiceLockPaths
, and addedAdmin.createAdminLock()
to support thisTestLock
(in test package) which is used by tests to create a real ZK lock, or a dummy one. RemovedcreateDummyLockID()
fromAbstractFateStore
(moved to TestLock), andcreateDummyLock()
is now only used in test code. Added new constantZTEST_LOCK = "/test/lock"
, changedServiceLockPaths
, and addedcreateTestLock()
which is used to create a real lock id (one held in ZK) which is needed for some tests.ExternalCompaction_1_IT
. Was using a dummy lock for the store before and the fate data was being stored in the same locations that theManager uses for it's fate data. The DeadReservationCleaner running in Manager would have cleaned up reservations created using this store if it ran when reservations were present. Now the test creates
a real ZK lock so the DeadReservationCleaner won't clean these up unexpectedly.
closes #4904