From 09f939f47454d9a36a911948ea05bc02859740e8 Mon Sep 17 00:00:00 2001 From: Finn Carroll Date: Tue, 11 Jun 2024 11:25:05 -0700 Subject: [PATCH] STASH. --- gradle/run.gradle | 6 +++++- .../remote/directory/RemoteSnapshotDirectory.java | 2 +- .../index/store/remote/utils/cache/LRUCache.java | 14 +++++++++++++- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/gradle/run.gradle b/gradle/run.gradle index 0aa5e5478fdce..524ae1fa10e80 100644 --- a/gradle/run.gradle +++ b/gradle/run.gradle @@ -47,9 +47,13 @@ testClusters { } // DEBUG SETTINGS - DO NOT COMMIT + setting 'node.search.cache.size', '100b' + //setting 'cluster.filecache.remote_data_ratio', '0' + setting 'node.roles', '[data,ingest,cluster_manager,search]' - setting 'node.search.cache.size', '13b' +// setting 'node.roles', '[search]' setting 'path.repo', '/Users/carrofin/fdev/DEBUG/STORES/SNAPS' +// setting 'path.data', '/fakemount' setting 'path.data', '/Users/carrofin/fdev/DEBUG/STORES/DATA' } diff --git a/server/src/main/java/org/opensearch/index/store/remote/directory/RemoteSnapshotDirectory.java b/server/src/main/java/org/opensearch/index/store/remote/directory/RemoteSnapshotDirectory.java index 167c190c57b7a..38bc56fe30d01 100644 --- a/server/src/main/java/org/opensearch/index/store/remote/directory/RemoteSnapshotDirectory.java +++ b/server/src/main/java/org/opensearch/index/store/remote/directory/RemoteSnapshotDirectory.java @@ -186,7 +186,7 @@ public void close() throws IOException { if (input != null) { input.close(); } - // cloneRefs.remove(ref); // For now don't remove for debugging + cloneRefs.remove(ref); } } super.close(); diff --git a/server/src/main/java/org/opensearch/index/store/remote/utils/cache/LRUCache.java b/server/src/main/java/org/opensearch/index/store/remote/utils/cache/LRUCache.java index 03d03711f914a..41832da621fd3 100644 --- a/server/src/main/java/org/opensearch/index/store/remote/utils/cache/LRUCache.java +++ b/server/src/main/java/org/opensearch/index/store/remote/utils/cache/LRUCache.java @@ -224,9 +224,11 @@ public void incRef(K key) { lru.remove(node.key); } + // INC REF debug statement node.refCount++; - } + System.out.println("INC REF: " + node.key.toString() + " to " + node.refCount); + } } finally { lock.unlock(); } @@ -239,7 +241,14 @@ public void decRef(K key) { try { Node node = data.get(key); if (node != null && node.refCount > 0) { + + // DEC REF debug statement node.refCount--; + System.out.println("DEC REF: " + node.key.toString() + " to " + node.refCount); + + if (node.refCount == 0) { + System.out.println("0000000000000000000000000 " + node.key.toString()); + } if (node.evictable()) { // if it becomes evictable, we should add it to eviction list @@ -360,6 +369,9 @@ private void evict() { data.remove(node.key, node); usage -= node.weight; statsCounter.recordEviction(node.weight); + + System.out.println("EVICTING FILE -: " + node.key.toString()); + listener.onRemoval(new RemovalNotification<>(node.key, node.value, RemovalReason.CAPACITY)); } }