bersler / OpenLogReplicator

Open Source Oracle database CDC
https://www.bersler.com
GNU General Public License v3.0
289 stars 133 forks source link

Archive log path: current day not polled except on startup #56

Closed Tom-Shaw closed 1 year ago

Tom-Shaw commented 1 year ago

https://github.com/bersler/OpenLogReplicator/blob/cc363de304667dc2480f0a29c311710e816b6830/src/replicator/Replicator.cpp#L488

When in type=offline mode, the tool only polls the archive log path once on startup and then doesn't see any new archived redo logs because it always skips the current day.

With the following change it will skip only the previously seen days, not the current day. (I haven't tested this in type=online + arch=path mode.)

--- Replicator.cpp.orig 2023-07-09 14:40:19.291668291 +1000
+++ Replicator.cpp      2023-07-09 18:19:44.866635031 +1000
@@ -485,7 +485,7 @@
                 continue;

             // Skip earlier days
-            if (replicator->lastCheckedDay == ent->d_name)
+            if (!replicator->lastCheckedDay.empty() && replicator->lastCheckedDay > ent->d_name)
                 continue;

             if (replicator->ctx->trace & TRACE_ARCHIVE_LIST)