From e29de4430b2dec312574dab1afc443e48ba788f0 Mon Sep 17 00:00:00 2001 From: Baoyi Chen Date: Sat, 9 Dec 2023 16:56:27 +0800 Subject: [PATCH] test --- .../com/moilioncircle/redis/replicator/online/PsyncTest.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/test/java/com/moilioncircle/redis/replicator/online/PsyncTest.java b/src/test/java/com/moilioncircle/redis/replicator/online/PsyncTest.java index 366e1357..43d2e6fa 100644 --- a/src/test/java/com/moilioncircle/redis/replicator/online/PsyncTest.java +++ b/src/test/java/com/moilioncircle/redis/replicator/online/PsyncTest.java @@ -83,12 +83,14 @@ public void psync() throws IOException { @Override public void onEvent(Replicator replicator, Event event) { if (event instanceof PreRdbSyncEvent) { + r.getLogger().info("id:{}, offset:{}", configuration.getReplId(), configuration.getReplOffset()); acc1.incrementAndGet(); } if (event instanceof KeyValuePair) { if (flag1.compareAndSet(false, true)) { // will trigger full sync at this time + r.getLogger().info("psync close 1"); close(replicator); } } @@ -96,6 +98,7 @@ public void onEvent(Replicator replicator, Event event) { if (event instanceof PostRdbSyncEvent) { if (flag.compareAndSet(false, true)) { // will trigger full sync at this time + r.getLogger().info("psync close 2"); close(replicator); Thread thread = new Thread(new JRun()); thread.setDaemon(true); @@ -108,6 +111,7 @@ public void onEvent(Replicator replicator, Event event) { if (acc.get() == 500) { //close current process port; //that will auto trigger psync command + r.getLogger().info("psync close 3"); r.getLogger().info("id:{}, offset:{}", configuration.getReplId(), configuration.getReplOffset()); close(replicator); } @@ -115,6 +119,7 @@ public void onEvent(Replicator replicator, Event event) { if (acc.get() == 1010) { //close current process port; //that will auto trigger psync command + r.getLogger().info("psync close 4"); r.getLogger().info("id:{}, offset:{}", configuration.getReplId(), configuration.getReplOffset()); close(replicator); }