@@ -167,6 +167,7 @@ private void validate( final FilterResult<Id> filterResult ) {
167167
168168 int edgesDeleted = 0 ;
169169 List <MarkedEdge > edgeList = graphManager .loadEdgeVersions (searchByEdge ).toList ().toBlocking ().last ();
170+ boolean timestampAllowsDelete = false ;
170171 if (edgeList .size () > 0 ) {
171172 MarkedEdge firstEdge = edgeList .get (0 );
172173 long currentTimestamp = CpNamingUtils .createGraphOperationTimestamp ();
@@ -176,6 +177,7 @@ private void validate( final FilterResult<Id> filterResult ) {
176177 // timestamps are in 100 nanoseconds, convert from seconds
177178 long allowedDiff = orphanDelaySecs * 1000L * 1000L * 10L ;
178179 if (timestampDiff > allowedDiff ) {
180+ timestampAllowsDelete = true ;
179181 // edges must be orphans, delete edges
180182 for (MarkedEdge edge : edgeList ) {
181183 graphManager .markEdge (edge ).toBlocking ().lastOrDefault (null );
@@ -188,6 +190,14 @@ private void validate( final FilterResult<Id> filterResult ) {
188190 if (edgesDeleted > 0 ) {
189191 logger .warn ("Read graph edge and received candidate with entityId {} (application {}), yet was not found in cassandra."
190192 + " Deleted at least {} edges." , candidateId , applicationScope .getApplication ().getUuid ().toString (), edgesDeleted );
193+ } else if (edgeList .size () == 0 ) {
194+ logger .warn ("Read graph edge and received candidate with entityId {} (application {}), yet was not found in cassandra."
195+ + " No edges were deleted (loadEdgeVersions returned 0 edges)" ,
196+ candidateId , applicationScope .getApplication ().getUuid ().toString ());
197+ } else if (timestampAllowsDelete ) {
198+ logger .warn ("Read graph edge and received candidate with entityId {} (application {}), yet was not found in cassandra."
199+ + " Timestamp is old enough to delete, but no edges were deleted (loadEdgeVersions returned {} edges)" ,
200+ candidateId , applicationScope .getApplication ().getUuid ().toString (), edgeList .size ());
191201 } else {
192202 logger .warn ("Read graph edge and received candidate with entityId {} (application {}), yet was not found in cassandra."
193203 + " Ignoring since this could be a region sync issue" , candidateId , applicationScope .getApplication ().getUuid ().toString ());
0 commit comments