Skip to content

Commit

Permalink
Preparation for debugging.
Browse files Browse the repository at this point in the history
  • Loading branch information
andrii0lomakin committed Dec 5, 2023
1 parent e8b4f36 commit ac52f88
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -362,9 +362,14 @@ class GarbageCollector(internal val environment: EnvironmentImpl) {
val loggables = log.getLoggableIterator(fileAddress)
while (loggables.hasNext()) {
val loggable = loggables.next()
if (loggable.address == 520806596608L) {
println("Bad boy !!!")
}

if (loggable == null || loggable.address >= nextFileAddress) {
break
}

val structureId = loggable.structureId
if (structureId != Loggable.NO_STRUCTURE_ID && structureId != EnvironmentImpl.META_TREE_ID) {
var store = openStoresCache.get(structureId)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,17 @@ internal class PatriciaTreeMutable(
): Boolean {
var l = loggable
var minAddress = l.address
if (minAddress == 520806596608L) {
println("Bad boy !!!")
}

while (true) {
val type = l.type

if (l.address == 520806596608L) {
println("Bad boy !!!")
}

if (type < NODE_WO_KEY_WO_VALUE_WO_CHILDREN || type > MAX_VALID_LOGGABLE_TYPE) {
if (type != NullLoggable.TYPE && type != HashCodeLoggable.TYPE) { // skip null loggable
throw ExodusException("Unexpected loggable type " + l.type)
Expand All @@ -285,9 +294,15 @@ internal class PatriciaTreeMutable(
if (!loggables.hasNext()) {
return false
}

l = loggables.next()
}

val maxAddress = l.address
if (maxAddress == 520806596608L) {
println("Bad boy !!!")
}

val sourceTree = PatriciaTreeForReclaim(log, maxAddress, structureId)
val sourceRoot = sourceTree.root
val backRef = sourceTree.backRef
Expand Down

0 comments on commit ac52f88

Please sign in to comment.