Skip to content

Commit ab812d5

Browse files
authored
Merge pull request #5466 from evolvedbinary/6.x.x/hotfix/ci-jdk-8-macos
[6.x.x] Switch CI from Temurin to Liberica
2 parents 024276e + 320cf57 commit ab812d5

File tree

7 files changed

+54
-26
lines changed

7 files changed

+54
-26
lines changed

.github/actions/install-mvnd/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ runs:
4848
- name: Cache mvnd
4949
if: inputs.cache == 'true'
5050
id: cache-mvnd
51-
uses: actions/cache@v3
51+
uses: actions/cache@v4
5252
with:
5353
path: |
5454
${{ inputs.install-path }}/${{ env.MVND_NAME }}.zip

.github/workflows/ci-deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
- name: Set up JDK 8
1414
uses: actions/setup-java@v4
1515
with:
16-
distribution: temurin
16+
distribution: liberica
1717
java-version: '8'
1818
- name: Make buildkit default
1919
uses: docker/setup-buildx-action@v3

.github/workflows/ci-test.yml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
- uses: actions/checkout@v4
1414
- uses: actions/setup-java@v4
1515
with:
16-
distribution: temurin
16+
distribution: liberica
1717
java-version: ${{ env.DEV_JDK }}
1818
cache: 'maven'
1919
- run: mvn -V -B license:check
@@ -25,7 +25,7 @@ jobs:
2525
- uses: actions/checkout@v4
2626
- uses: actions/setup-java@v4
2727
with:
28-
distribution: temurin
28+
distribution: liberica
2929
java-version: ${{ env.DEV_JDK }}
3030
cache: 'maven'
3131
- name: OWASP dependency check
@@ -40,26 +40,20 @@ jobs:
4040
matrix:
4141
os: [ubuntu-latest, windows-latest, macOS-latest]
4242
jvm: ['8']
43-
exclude:
44-
- os: macOS-latest
45-
jvm: '8'
46-
include:
47-
- os: macOS-latest
48-
jvm: '11'
4943
runs-on: ${{ matrix.os }}
5044
steps:
5145
- uses: actions/checkout@v4
5246
- name: Set up JDK
5347
uses: actions/setup-java@v4
5448
with:
55-
distribution: temurin
49+
distribution: liberica
5650
java-version: ${{ matrix.jvm }}
5751
cache: 'maven'
5852
- name: Install Maven Daemon
5953
id: install-mvnd
6054
uses: ./.github/actions/install-mvnd
6155
with:
62-
version: '1.0.1'
56+
version: '1.0.2'
6357
file-version-suffix: ''
6458
cache: 'true'
6559
- name: Maven Build

.github/workflows/ci-xqts.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
- name: Set up JDK 8
1313
uses: actions/setup-java@v4
1414
with:
15-
distribution: temurin
15+
distribution: liberica
1616
java-version: '8'
1717
- name: Cache Maven packages
1818
uses: actions/cache@v4

exist-core/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1097,7 +1097,7 @@ The BaseX Team. The original license statement is also included below.]]></pream
10971097
</dependency>
10981098
</dependencies>
10991099
<configuration>
1100-
<argLine>@{jacocoArgLine} -Dfile.encoding=${project.build.sourceEncoding}</argLine>
1100+
<argLine>@{jacocoArgLine} -Dfile.encoding=${project.build.sourceEncoding} -Dexist.recovery.progressbar.hide=true</argLine>
11011101
<systemPropertyVariables>
11021102
<jetty.home>${project.basedir}/../exist-jetty-config/target/classes/org/exist/jetty</jetty.home>
11031103
<exist.configurationFile>${project.build.testOutputDirectory}/conf.xml</exist.configurationFile>

exist-core/src/main/java/org/exist/plugin/PluginsManagerImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ public void addPlugin(final String className) {
241241
// NOTE: must set interrupted flag
242242
Thread.currentThread().interrupt();
243243
}
244-
LOG.error(e);
244+
LOG.warn(e);
245245
}
246246
}
247247

exist-core/src/main/java/org/exist/storage/recovery/RecoveryManager.java

Lines changed: 45 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@
4545
import com.evolvedbinary.j8fu.function.SupplierE;
4646
import org.exist.util.sanity.SanityCheck;
4747

48+
import javax.annotation.Nullable;
49+
4850
/**
4951
* Database recovery. This class is used once during startup to check
5052
* if the database is in a consistent state. If not, the class attempts to recover
@@ -59,11 +61,13 @@ public class RecoveryManager {
5961
private final DBBroker broker;
6062
private final JournalRecoveryAccessor journalRecovery;
6163
private final boolean restartOnError;
64+
private final boolean hideProgressBar;
6265

6366
public RecoveryManager(final DBBroker broker, final JournalManager journalManager, final boolean restartOnError) {
6467
this.broker = broker;
6568
this.journalRecovery = journalManager.getRecoveryAccessor(this);
6669
this.restartOnError = restartOnError;
70+
this.hideProgressBar = Boolean.getBoolean("exist.recovery.progressbar.hide");
6771
}
6872

6973
/**
@@ -120,10 +124,10 @@ public boolean recover() throws LogException {
120124
Lsn lastLsn = Lsn.LSN_INVALID;
121125
Loggable next;
122126
try {
123-
final ProgressBar progress = new ProgressBar("Scanning journal ", FileUtils.sizeQuietly(last));
127+
final long lastSize = FileUtils.sizeQuietly(last);
128+
@Nullable final ProgressBar scanProgressBar = hideProgressBar ? null : new ProgressBar("Scanning journal ", lastSize);
124129
while ((next = reader.nextEntry()) != null) {
125130
// LOG.debug(next.dump());
126-
progress.set(next.getLsn().getOffset());
127131
if (next.getLogType() == LogEntryTypes.TXN_START) {
128132
// new transaction starts: add it to the transactions table
129133
txnsStarted.put(next.getTransactionId(), next);
@@ -135,6 +139,14 @@ public boolean recover() throws LogException {
135139
lastCheckpoint = (Checkpoint) next;
136140
}
137141
lastLsn = next.getLsn();
142+
143+
if (scanProgressBar != null) {
144+
scanProgressBar.set(next.getLsn().getOffset());
145+
}
146+
}
147+
148+
if (scanProgressBar != null) {
149+
scanProgressBar.set(lastSize); // 100%
138150
}
139151
} catch (final LogException e) {
140152
if (LOG.isDebugEnabled()) {
@@ -146,7 +158,7 @@ public boolean recover() throws LogException {
146158
// if the last checkpoint record is not the last record in the file
147159
// we need a recovery.
148160
if ((lastCheckpoint == null || !lastCheckpoint.getLsn().equals(lastLsn)) &&
149-
txnsStarted.size() > 0) {
161+
!txnsStarted.isEmpty()) {
150162
LOG.info("Dirty transactions: {}", txnsStarted.size());
151163
// starting recovery: reposition the log reader to the last checkpoint
152164
if (lastCheckpoint == null) {
@@ -250,10 +262,11 @@ private void doRecovery(final int txnCount, final Path last, final JournalReader
250262
if (LOG.isInfoEnabled())
251263
{
252264
LOG.info("First pass: redoing {} transactions...", txnCount);}
253-
final ProgressBar progress = new ProgressBar("Redo ", FileUtils.sizeQuietly(last));
254265
Loggable next = null;
255266
int redoCnt = 0;
256267
try {
268+
final long lastSize = FileUtils.sizeQuietly(last);
269+
@Nullable final ProgressBar redoProgressBar = hideProgressBar ? null : new ProgressBar("Redo ", lastSize);
257270
while ((next = reader.nextEntry()) != null) {
258271
SanityCheck.ASSERT(next.getLogType() != LogEntryTypes.CHECKPOINT,
259272
"Found a checkpoint during recovery run! This should not ever happen.");
@@ -271,9 +284,19 @@ private void doRecovery(final int txnCount, final Path last, final JournalReader
271284
// LOG.debug("Redo: " + next.dump());
272285
// redo the log entry
273286
next.redo();
274-
progress.set(next.getLsn().getOffset());
275-
if (next.getLsn().equals(lastLsn))
276-
{break;} // last readable entry reached. Stop here.
287+
288+
if (redoProgressBar != null) {
289+
redoProgressBar.set(next.getLsn().getOffset());
290+
}
291+
292+
if (next.getLsn().equals(lastLsn)) {
293+
// last readable entry reached. Stop here.
294+
break;
295+
}
296+
}
297+
298+
if (redoProgressBar != null) {
299+
redoProgressBar.set(lastSize); // 100% done
277300
}
278301
} catch (final Exception e) {
279302
LOG.error("Exception caught while redoing transactions. Aborting recovery to avoid possible damage. " +
@@ -291,16 +314,19 @@ private void doRecovery(final int txnCount, final Path last, final JournalReader
291314
{
292315
LOG.info("Second pass: undoing dirty transactions. Uncommitted transactions: {}", runningTxns.size());}
293316
// see if there are uncommitted transactions pending
294-
if (runningTxns.size() > 0) {
317+
if (!runningTxns.isEmpty()) {
295318
// do a reverse scan of the log, undoing all uncommitted transactions
296319
try {
297-
while((next = reader.previousEntry()) != null) {
320+
final long lastSize = FileUtils.sizeQuietly(last);
321+
final ProgressBar undoProgressBar = hideProgressBar ? null : new ProgressBar("Undo ", lastSize);
322+
while ((next = reader.previousEntry()) != null) {
298323
if (next.getLogType() == LogEntryTypes.TXN_START) {
299324
if (runningTxns.get(next.getTransactionId()) != null) {
300325
runningTxns.remove(next.getTransactionId());
301-
if (runningTxns.size() == 0)
326+
if (runningTxns.isEmpty()) {
302327
// all dirty transactions undone
303-
{break;}
328+
break;
329+
}
304330
}
305331
} else if (next.getLogType() == LogEntryTypes.TXN_COMMIT) {
306332
// ignore already committed transaction
@@ -314,6 +340,14 @@ private void doRecovery(final int txnCount, final Path last, final JournalReader
314340
// LOG.debug("Undo: " + next.dump());
315341
next.undo();
316342
}
343+
344+
if (undoProgressBar != null) {
345+
undoProgressBar.set(lastSize - next.getLsn().getOffset());
346+
}
347+
}
348+
349+
if (undoProgressBar != null) {
350+
undoProgressBar.set(lastSize); // 100% done
317351
}
318352
} catch (final Exception e) {
319353
LOG.warn("Exception caught while undoing dirty transactions. Remaining transactions to be undone: {}. Aborting recovery to avoid possible damage. Before starting again, make sure to run a check via the emergency export tool.", runningTxns.size(), e);

0 commit comments

Comments
 (0)