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

AMBARI-26091: Fix remote cluster cannot be deregistered #3792

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

Conversation

liqinwyyx
Copy link
Contributor

@liqinwyyx liqinwyyx commented Jul 2, 2024

What changes were proposed in this pull request?

微信图片_20240703154812

Here is how I reproduce the problem:

  1. Click Remote Cluster, Then click Add button to create a new cluster in Ambari.
  2. Modify the remote cluster name from MyRemoteCluster to NewRemoteCluster.
  3. After I updated the cluster name, I clicked the deregister remote cluster button and found no response on the page.
  4. When I refreshed the page, the cluster I added was still there. So I conclude that this is a bug for remote clusters.

Here is my ideas for solving the problem:
When I updated the name of the remote cluster, the database was updated. For some reason, the JPA cache was not updated, but the query interface directly looked up the database, so there was no problem.
When I delete the data in the cache and delete it in the database, I find that the data in the cache is inconsistent with the database, so the deletion fails.
In the end, I achieved consistency between the cached data and the database after the update by deleting the cache before the update. The natural problem has also been solved.

How was this patch tested?

(Please explain how this patch was tested. Ex: unit tests, manual tests)
(If this patch involves UI changes, please attach a screen-shot; otherwise, remove this)

Please review Ambari Contributing Guide before opening a pull request.

Copy link
Contributor

@JiaLiangC JiaLiangC left a comment

Choose a reason for hiding this comment

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

There is indeed a bug here: the JPA cache becomes inconsistent with the database data after an update, which leads to being unable to unregister. However, even after applying your patch locally, the problem still persists. The delete operation you perform during the update causes subsequent updates to fail because there is no corresponding object in the database.

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.

2 participants