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

Fixes bug resolving lock w/ empty col fam. Reported in #660 #1123

Merged
merged 2 commits into from
Nov 16, 2022

Conversation

keith-turner
Copy link
Contributor

There was a bug where if a column family was empty and the qual was not empty this would cause lock recovery to fail. The underlying cause was a bug in the Column class. This class has an isFamilySet() method that was returning false when the family was set to the empty string. This cause caused lock recovery code to create an incorrect range.

The Column class was relying on internal behavior of the Bytes class that probably changed and caused this bug.

This commit adds a new IT that recreates this bug. If the new IT is run w/o the fix to the Column class then it would fail as follows.

Running org.apache.fluo.integration.impl.FailureIT
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 8.011 sec <<< FAILURE! - in org.apache.fluo.integration.impl.FailureIT
testRecoverEmptyColumn(org.apache.fluo.integration.impl.FailureIT)  Time elapsed: 7.096 sec  <<< ERROR!
java.lang.IllegalStateException: can not abort : bob  bal  5 (UNKNOWN)
	at org.apache.fluo.integration.impl.FailureIT.testRecoverEmptyColumn(FailureIT.java:688)

There was a bug where if a column family was empty and the qual was not
empty this would cause lock recovery to fail.  The underlying cause was
a bug in the Column class.  This class has an isFamilySet() method that
was returning false when the family was set to the empty string.  This
cause caused lock recovery code to create an incorrect range.

The Column class was relying on internal behavior of the Bytes class
that probably changed and caused this bug.

This commit adds a new IT that recreates this bug.  If the new IT is run
w/o the fix to the Column class then it would fail as follows.

```
Running org.apache.fluo.integration.impl.FailureIT
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 8.011 sec <<< FAILURE! - in org.apache.fluo.integration.impl.FailureIT
testRecoverEmptyColumn(org.apache.fluo.integration.impl.FailureIT)  Time elapsed: 7.096 sec  <<< ERROR!
java.lang.IllegalStateException: can not abort : bob  bal  5 (UNKNOWN)
	at org.apache.fluo.integration.impl.FailureIT.testRecoverEmptyColumn(FailureIT.java:688)
```
@keith-turner
Copy link
Contributor Author

All ITs pass for ee51445

Copy link
Member

@ctubbsii ctubbsii left a comment

Choose a reason for hiding this comment

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

Looks good, but I made a few suggestions to polish it up a tiny bit

@keith-turner keith-turner merged commit 38adfdb into apache:main Nov 16, 2022
@ctubbsii ctubbsii added this to the 2.0.0 milestone Nov 16, 2022
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