Skip to content

Commit

Permalink
Fix delete logging
Browse files Browse the repository at this point in the history
  • Loading branch information
dmgaldi committed Jan 22, 2024
1 parent 8b6b68a commit b2ee1be
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,13 @@ class DatasetManager(private val s3Bucket: S3Bucket) {
// Stream is exhausted, construct a dataset out of remaining objects.
val idsFromObject = datasetIdFromS3Object(stagedObjects.first())
val pathFactory = S3DatasetPathFactory(idsFromObject.first, idsFromObject.second)
this.currentDataset = EagerlyLoadedDatasetDirectory(stagedObjects, idsFromObject.first, idsFromObject.second, pathFactory)
try {
this.currentDataset = EagerlyLoadedDatasetDirectory(stagedObjects, idsFromObject.first, idsFromObject.second, pathFactory)
} catch (e: MalformedDatasetException) {
Metrics.malformedDatasetFound.inc()
log.warn("Found a malformed dataset with ID $idsFromObject.")
return null
}
stagedObjects = emptyList()
return currentDataset
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,12 @@ class ReconcilerInstance(

// Delete datasets until and advance target iterator until streams are aligned.
while (nextTargetDataset != null && comparableS3Id.compareTo(comparableTargetId, true) > 0) {
logger().info("Attempting to delete dataset with owner ${sourceDatasetDir.ownerID} and ID ${sourceDatasetDir.datasetID} " +
"because ${nextTargetDataset!!.syncControlRecord.datasetID} is lexigraphically greater than our ID.")

logger().info("Attempting to delete dataset with owner $comparableTargetId " +
"because $comparableS3Id is lexigraphically greater than $comparableTargetId.")
tryDeleteDataset(targetDB, nextTargetDataset!!.type, nextTargetDataset!!.syncControlRecord.datasetID)
nextTargetDataset = if (targetIterator.hasNext()) targetIterator.next() else null
comparableTargetId = nextTargetDataset!!.getComparableID()
}
}

Expand Down

0 comments on commit b2ee1be

Please sign in to comment.