mirror of https://github.com/apache/activemq.git
https://issues.apache.org/jira/browse/AMQ-6083 - resolve some test regressions - AMQ2149Test - fail to start with missing data file. Ensure ack map is always saved on modification
This commit is contained in:
parent
8609f74db3
commit
31d99b6aa9
|
@ -1739,6 +1739,7 @@ public abstract class MessageDatabase extends ServiceSupport implements BrokerSe
|
||||||
LOG.trace("gc candidates: " + gcCandidateSet);
|
LOG.trace("gc candidates: " + gcCandidateSet);
|
||||||
LOG.trace("ackMessageFileMap: " + metadata.ackMessageFileMap);
|
LOG.trace("ackMessageFileMap: " + metadata.ackMessageFileMap);
|
||||||
}
|
}
|
||||||
|
boolean ackMessageFileMapMod = false;
|
||||||
Iterator<Integer> candidates = gcCandidateSet.iterator();
|
Iterator<Integer> candidates = gcCandidateSet.iterator();
|
||||||
while (candidates.hasNext()) {
|
while (candidates.hasNext()) {
|
||||||
Integer candidate = candidates.next();
|
Integer candidate = candidates.next();
|
||||||
|
@ -1752,7 +1753,7 @@ public abstract class MessageDatabase extends ServiceSupport implements BrokerSe
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (gcCandidateSet.contains(candidate)) {
|
if (gcCandidateSet.contains(candidate)) {
|
||||||
metadata.ackMessageFileMap.remove(candidate);
|
ackMessageFileMapMod |= (metadata.ackMessageFileMap.remove(candidate) != null);
|
||||||
} else {
|
} else {
|
||||||
if (LOG.isTraceEnabled()) {
|
if (LOG.isTraceEnabled()) {
|
||||||
LOG.trace("not removing data file: " + candidate
|
LOG.trace("not removing data file: " + candidate
|
||||||
|
@ -1767,7 +1768,6 @@ public abstract class MessageDatabase extends ServiceSupport implements BrokerSe
|
||||||
LOG.debug("Cleanup removing the data files: " + gcCandidateSet);
|
LOG.debug("Cleanup removing the data files: " + gcCandidateSet);
|
||||||
}
|
}
|
||||||
journal.removeDataFiles(gcCandidateSet);
|
journal.removeDataFiles(gcCandidateSet);
|
||||||
boolean ackMessageFileMapMod = false;
|
|
||||||
for (Integer candidate : gcCandidateSet) {
|
for (Integer candidate : gcCandidateSet) {
|
||||||
for (Set<Integer> ackFiles : metadata.ackMessageFileMap.values()) {
|
for (Set<Integer> ackFiles : metadata.ackMessageFileMap.values()) {
|
||||||
ackMessageFileMapMod |= ackFiles.remove(candidate);
|
ackMessageFileMapMod |= ackFiles.remove(candidate);
|
||||||
|
|
Loading…
Reference in New Issue