wchevreuil commented on a change in pull request #437: HBASE-22539 WAL
corruption due to early DBBs re-use when Durability.A…
URL: https://github.com/apache/hbase/pull/437#discussion_r310053471
##########
File path:
hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/ServerCall.java
##########
@@ -141,14 +147,43 @@ public void done() {
cleanup();
}
+ private void release(int mask) {
+ for (;;) {
+ int ref = reference.get();
+ if ((ref & mask) == 0) {
+ return;
+ }
+ int nextRef = ref & (~mask);
+ if (reference.compareAndSet(ref, nextRef)) {
+ if (nextRef == 0) {
+ if (this.reqCleanup != null) {
+ this.reqCleanup.run();
+ }
+ }
+ return;
+ }
+ }
+ }
+
@Override
public void cleanup() {
- if (this.reqCleanup != null) {
- this.reqCleanup.run();
- this.reqCleanup = null;
+ release(0b01);
+ }
+
+ public void retainByWAL() {
+ for (;;) {
Review comment:
Should rather wait for notifications from releaseByWal()?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services