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

Modify partition's version name to what it means #334

Merged
merged 3 commits into from
Nov 21, 2018

Conversation

morningman
Copy link
Contributor

  1. committedVersion(Hash) -> visibleVersion(Hash)
  2. currentVersion(Hash) -> committedVersion(Hash)
  3. add some comment to make the code more readable.
  4. fix a ut bug that editlog may be null in CatalogIdGenerator.

1. committedVersion(Hash) -> visibleVersion(Hash)
2. currentVersion(Hash) -> committedVersion(Hash)
3. add some comment to make the code more readable
if (allBackends == null || allBackends.size() == 0) {
LOG.warn("some transaction state need to publish, but no alive backends!!!");
if (allBackends.isEmpty()) {
LOG.warn("some transaction state need to publish, but no backend exists");
return;
Copy link
Contributor

Choose a reason for hiding this comment

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

if allbackends == null ,then nptr throws

Copy link
Contributor Author

Choose a reason for hiding this comment

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

allbackends never returns null

@@ -448,35 +454,40 @@ public void abortTransaction(Long dbId, String label, String reason) throws User
continue;
}
db.readLock();
writeLock();
try {
Copy link
Contributor

Choose a reason for hiding this comment

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

why not use write lock

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is no changing here, so read lock is enough.

Copy link
Contributor

@imay imay left a comment

Choose a reason for hiding this comment

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

LGTM

@imay imay merged commit 485db34 into apache:master Nov 21, 2018
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