>From Peeyush Gupta <[email protected]>:

Peeyush Gupta has uploaded this change for review. ( 
https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/18295 )


Change subject: [ASTERIXDB-3400][IDX] Possible deadlock in 
GlobalVirtualBufferCache
......................................................................

[ASTERIXDB-3400][IDX] Possible deadlock in GlobalVirtualBufferCache

- user model changes: no
- storage format changes: no
- interface changes: no

Change-Id: Ib9794c716772536336f1ed8112519e174fe02fd9
---
M 
asterixdb/asterix-common/src/main/java/org/apache/asterix/common/context/GlobalVirtualBufferCache.java
1 file changed, 20 insertions(+), 4 deletions(-)



  git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb 
refs/changes/95/18295/1

diff --git 
a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/context/GlobalVirtualBufferCache.java
 
b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/context/GlobalVirtualBufferCache.java
index a4663ed..1ba9ac6 100644
--- 
a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/context/GlobalVirtualBufferCache.java
+++ 
b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/context/GlobalVirtualBufferCache.java
@@ -177,13 +177,16 @@
             // 2. there are still some active readers and memory cannot be 
reclaimed.
             // But for both cases, we will notify all primary index op 
trackers to let their writers retry,
             // if they have been blocked. Moreover, we will check whether more 
flushes are needed.
+            List<ILSMOperationTracker> opTrackers = new ArrayList<>();
             synchronized (this) {
                 final int size = primaryIndexes.size();
                 for (int i = 0; i < size; i++) {
-                    ILSMOperationTracker opTracker = 
primaryIndexes.get(i).getOperationTracker();
-                    synchronized (opTracker) {
-                        opTracker.notifyAll();
-                    }
+                    
opTrackers.add(primaryIndexes.get(i).getOperationTracker());
+                }
+            }
+            for (ILSMOperationTracker opTracker : opTrackers) {
+                synchronized (opTracker) {
+                    opTracker.notifyAll();
                 }
             }
             checkAndNotifyFlushThread();

--
To view, visit https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/18295
To unsubscribe, or for help writing mail filters, visit 
https://asterix-gerrit.ics.uci.edu/settings

Gerrit-Project: asterixdb
Gerrit-Branch: neo
Gerrit-Change-Id: Ib9794c716772536336f1ed8112519e174fe02fd9
Gerrit-Change-Number: 18295
Gerrit-PatchSet: 1
Gerrit-Owner: Peeyush Gupta <[email protected]>
Gerrit-MessageType: newchange

Reply via email to