Wipeout freespace - #2125
Conversation
There was a problem hiding this comment.
Pull Request Overview
This pull request enhances byte array handling and free space management by adding new methods and parameters to improve compression and data wiping operations. Key changes include:
- Introducing new overloads for the putBytes method in Binary and BinaryStructure.
- Modifying compressPage methods (in LocalBucket, DatabaseChecker, and TransactionContext) to include a forceWipeOut parameter.
- Adding a ZERO_BYTES_ARRAY in MutablePage to accelerate zero-filling and implementing a new wipeOutFreeSpace method in LocalBucket.
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| engine/src/main/java/com/arcadedb/engine/MutablePage.java | Added ZERO_BYTES_ARRAY and optimized writeZeros method. |
| engine/src/main/java/com/arcadedb/engine/LocalBucket.java | Updated compressPage signature and introduced wipeOutFreeSpace method. |
| engine/src/main/java/com/arcadedb/engine/DatabaseChecker.java | Updated compressPage call to force wipe out free space. |
| engine/src/main/java/com/arcadedb/database/TransactionContext.java | Updated compressPage calls with new boolean parameter. |
| engine/src/main/java/com/arcadedb/database/BinaryStructure.java | Added new putBytes overload with an index parameter. |
| engine/src/main/java/com/arcadedb/database/Binary.java | Added new putBytes overload with an index parameter. |
Comments suppressed due to low confidence (2)
engine/src/main/java/com/arcadedb/engine/LocalBucket.java:1198
- [nitpick] Consider adding a delimiter or space between the computed value (page.pageId.getPageNumber() * maxRecordsInPage) and positionInPage to improve the clarity of the error message.
LogManager.instance().log(this, Level.SEVERE, "Error on loading record #" + fileId + ":" + (page.pageId.getPageNumber() * maxRecordsInPage) + positionInPage);
engine/src/main/java/com/arcadedb/engine/LocalBucket.java:1071
- [nitpick] The method name 'wipeOutFreeSpace' could be more descriptive; consider renaming it to 'wipePageFreeSpace' to clearly indicate that it operates on the page's free space.
private void wipeOutFreeSpace(final MutablePage page, final short recordCountInPage) throws IOException {
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferences |
* feat: wipe out free content in page This helps with backup because of ZIP compression * test: fixed broken page testcase * fix: forced wiping out in LocalBucket.compressPage() in all the cases * fix: moved wipeout only when necessary or forced by database checker
…p ci] Bumps the go-modules group in /e2e-go with 2 updates: [github.com/moby/go-archive](https://github.com/moby/go-archive) and [github.com/shirou/gopsutil/v4](https://github.com/shirou/gopsutil). Updates `github.com/moby/go-archive` from 0.2.1 to 0.3.2 Release notes *Sourced from [github.com/moby/go-archive's releases](https://github.com/moby/go-archive/releases).* > v0.3.2 > ------ > > What's Changed > -------------- > > Fix a regression introduced in v0.3.0 that caused archive extraction to fail when paths traversed absolute symlinks inside the destination root, such as `var/run -> /run`. Absolute symlink targets are now resolved relative to the extraction root while relative symlink escapes remain rejected. [moby/go-archive#93](https://redirect.github.com/moby/go-archive/pull/93) > > **Full Changelog**: <moby/go-archive@v0.3.1...v0.3.2> > > v0.3.1 > ------ > > Fixes > ----- > > This patch release fixes a regression introduced in v0.2.1 where archive extraction could fail when an archive omitted explicit entries for parent directories. For example, extracting `etc/dnf/` without a preceding `etc/` entry could return `mkdirat etc/dnf: no such file or directory`. > > This prevented affected images from being extracted. Archive extraction now creates implied parent directories for both file and directory entries. > > What's Changed > -------------- > > * archive: create implied parents for directory entries [moby/go-archive#92](https://redirect.github.com/moby/go-archive/pull/92) > * archive: Tarballer.Go: suppress io.ErrClosedPipe logs on close [moby/go-archive#94](https://redirect.github.com/moby/go-archive/pull/94) > > **Full Changelog**: <moby/go-archive@v0.3.0...v0.3.1> > > v0.3.0 > ------ > > Security > -------- > > This release fixes **CVE-2026-17106** / **[GHSA-hfg8-hc9c-6c3h](https://github.com/moby/go-archive/security/advisories/GHSA-hfg8-hc9c-6c3h)**, where a crafted tar archive could use links to cause extraction operations to create or overwrite files outside the intended destination directory. > > The issue affected `Unpack`, `UnpackLayer`, `Untar`, `UntarUncompressed`, and the `ApplyLayer` helpers. Users should upgrade and avoid extracting untrusted archives with earlier versions. > > What's Changed > -------------- > > * archive: harden tar extraction against path traversal [moby/go-archive#45](https://redirect.github.com/moby/go-archive/pull/45) > * archive: do not follow reparse points in chtimes [moby/go-archive#90](https://redirect.github.com/moby/go-archive/pull/90) > * archive: fix creation time updates on Windows [moby/go-archive#79](https://redirect.github.com/moby/go-archive/pull/79) > * archive: minor cleanups and godoc touch-up [moby/go-archive#87](https://redirect.github.com/moby/go-archive/pull/87) > * archive: RebaseArchiveEntries: fix archive path rebasing [moby/go-archive#43](https://redirect.github.com/moby/go-archive/pull/43) > > Test and CI changes > ------------------- > > * ci: enable dependabot for actions [moby/go-archive#81](https://redirect.github.com/moby/go-archive/pull/81) > * archive: make breakoutErr unwrap its cause [moby/go-archive#91](https://redirect.github.com/moby/go-archive/pull/91) > * archive: use filepath for filesystem paths in tests [moby/go-archive#80](https://redirect.github.com/moby/go-archive/pull/80) > * archive: use filepath for filesystem paths in tests [moby/go-archive#80](https://redirect.github.com/moby/go-archive/pull/80) > > **Full Changelog**: <moby/go-archive@v0.2.1...v0.3.0> Commits * [`9e6d2c7`](moby/go-archive@9e6d2c7) Merge pull request [#93](https://redirect.github.com/moby/go-archive/issues/93) from thaJeztah/fix\_absolute\_symlinks * [`4f6cd58`](moby/go-archive@4f6cd58) archive: resolve hardlinks through absolute symlinks * [`e564ecc`](moby/go-archive@e564ecc) archive: resolve absolute symlinks within extraction root * [`5bb8a45`](moby/go-archive@5bb8a45) Merge pull request [#94](https://redirect.github.com/moby/go-archive/issues/94) from thaJeztah/denoise * [`1bec7ec`](moby/go-archive@1bec7ec) archive: Tarballer.Go: suppress io.ErrClosedPipe logs on close * [`279fa6d`](moby/go-archive@279fa6d) Merge pull request [#92](https://redirect.github.com/moby/go-archive/issues/92) from thaJeztah/fix\_implied\_directories * [`517985a`](moby/go-archive@517985a) archive: create implied parents for directory entries * [`1c23372`](moby/go-archive@1c23372) Merge pull request [#43](https://redirect.github.com/moby/go-archive/issues/43) from thaJeztah/fix\_rebase\_from\_root * [`8829a25`](moby/go-archive@8829a25) RebaseArchiveEntries: fix archive path rebasing * [`c583b20`](moby/go-archive@c583b20) Merge pull request [#90](https://redirect.github.com/moby/go-archive/issues/90) from thaJeztah/chtimes\_nofollow * Additional commits viewable in [compare view](moby/go-archive@v0.2.1...v0.3.2) Updates `github.com/shirou/gopsutil/v4` from 4.26.6 to 4.26.7 Release notes *Sourced from [github.com/shirou/gopsutil/v4's releases](https://github.com/shirou/gopsutil/releases).* > v4.26.7 > ------- > > What's Changed > -------------- > > ### cpu > > * fix: harden parsers against malformed/truncated input by [`@shirou`](https://github.com/shirou) in [shirou/gopsutil#2109](https://redirect.github.com/shirou/gopsutil/pull/2109) > * [cpu][windows]: compute cpu-total times from integer ticks by [`@skartikey`](https://github.com/skartikey) in [shirou/gopsutil#2111](https://redirect.github.com/shirou/gopsutil/pull/2111) > * [darwin][process]: fix errno handling and library lifetime on darwin by [`@shirou`](https://github.com/shirou) in [shirou/gopsutil#2119](https://redirect.github.com/shirou/gopsutil/pull/2119) > * [cpu][windows]: compute total counters from individual stats to handle processor groups correctly by [`@srebhan`](https://github.com/srebhan) in [shirou/gopsutil#2125](https://redirect.github.com/shirou/gopsutil/pull/2125) > * [cpu][windows]: harden the cpu-total computation added in [#2125](https://redirect.github.com/shirou/gopsutil/issues/2125) by [`@shirou`](https://github.com/shirou) in [shirou/gopsutil#2128](https://redirect.github.com/shirou/gopsutil/pull/2128) > > ### net > > * fix(net): pad GetExtendedTcpTable buffer to prevent GC thrashing on Windows by [`@HarshalPatel1972`](https://github.com/HarshalPatel1972) in [shirou/gopsutil#2108](https://redirect.github.com/shirou/gopsutil/pull/2108) > > ### process > > * process: implement Darwin IOCounters via proc\_pid\_rusage by [`@DavRack`](https://github.com/DavRack) in [shirou/gopsutil#2117](https://redirect.github.com/shirou/gopsutil/pull/2117) > > ### other > > * feat: add psutil comparison tests for cpu, mem and load by [`@shirou`](https://github.com/shirou) in [shirou/gopsutil#2114](https://redirect.github.com/shirou/gopsutil/pull/2114) > > New Contributors > ---------------- > > * [`@DavRack`](https://github.com/DavRack) made their first contribution in [shirou/gopsutil#2117](https://redirect.github.com/shirou/gopsutil/pull/2117) > * [`@srebhan`](https://github.com/srebhan) made their first contribution in [shirou/gopsutil#2125](https://redirect.github.com/shirou/gopsutil/pull/2125) > > **Full Changelog**: <shirou/gopsutil@v4.26.6...v4.26.7> Commits * [`52a24c8`](shirou/gopsutil@52a24c8) Merge pull request [#2128](https://redirect.github.com/shirou/gopsutil/issues/2128) from shirou/feat/follow-up-2125 * [`268a953`](shirou/gopsutil@268a953) [cpu][windows]: harden the cpu-total computation added in [#2125](https://redirect.github.com/shirou/gopsutil/issues/2125) * [`1e34da6`](shirou/gopsutil@1e34da6) Merge pull request [#2125](https://redirect.github.com/shirou/gopsutil/issues/2125) from srebhan/fix\_cpu\_windows\_total * [`61f8802`](shirou/gopsutil@61f8802) Merge pull request [#2122](https://redirect.github.com/shirou/gopsutil/issues/2122) from shirou/dependabot/github\_actions/actions/checko... * [`7fb4dcf`](shirou/gopsutil@7fb4dcf) Merge pull request [#2123](https://redirect.github.com/shirou/gopsutil/issues/2123) from shirou/dependabot/github\_actions/actions/setup-... * [`ae7d91a`](shirou/gopsutil@ae7d91a) Merge pull request [#2119](https://redirect.github.com/shirou/gopsutil/issues/2119) from shirou/fix/darwin-errno-and-libcache * [`49052a1`](shirou/gopsutil@49052a1) [darwin][process]: use a PID above PID\_MAX in the not-running tests * [`991b238`](shirou/gopsutil@991b238) [darwin]: pass the remaining Go pointers as unsafe.Pointer on darwin * [`b9930e2`](shirou/gopsutil@b9930e2) Merge pull request [#2124](https://redirect.github.com/shirou/gopsutil/issues/2124) from shirou/dependabot/github\_actions/actions/labele... * [`38a01b4`](shirou/gopsutil@38a01b4) [cpu][windows]: compute total counters from individual stats to handle proces... * Additional commits viewable in [compare view](shirou/gopsutil@v4.26.6...v4.26.7) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- Dependabot commands and options You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore major version` will close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself) - `@dependabot ignore minor version` will close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself) - `@dependabot ignore ` will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself) - `@dependabot unignore ` will remove all of the ignore conditions of the specified dependency - `@dependabot unignore ` will remove the ignore condition of the specified dependency and ignore conditions
…in /studio [skip ci] Bumps [postcss](https://github.com/postcss/postcss) from 8.5.25 to 8.5.26. Release notes *Sourced from [postcss's releases](https://github.com/postcss/postcss/releases).* > 8.5.26 > ------ > > * Fixed `list.split()` regression (by [`@lazerg`](https://github.com/lazerg)). > * Track symlinks in path protection in source map loading (by [`@drengir1`](https://github.com/drengir1)). Changelog *Sourced from [postcss's changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md).* > 8.5.26 > ------ > > * Fixed `list.split()` regression (by [`@lazerg`](https://github.com/lazerg)). > * Track symlinks in path protection in source map loading (by [`@drengir1`](https://github.com/drengir1)). Commits * [`07b2577`](postcss/postcss@07b2577) Release 8.5.26 version * [`47de6b9`](postcss/postcss@47de6b9) Update CI * [`1493a83`](postcss/postcss@1493a83) Fix Rule#selectors losing the empty selector ([#2129](https://redirect.github.com/postcss/postcss/issues/2129)) * [`180db16`](postcss/postcss@180db16) Typo * [`29e9e00`](postcss/postcss@29e9e00) Resolve symlinks before the previous-source-map containment check ([#2125](https://redirect.github.com/postcss/postcss/issues/2125)) * [`3ba8f84`](postcss/postcss@3ba8f84) Update dependencies * [`87e72f6`](postcss/postcss@87e72f6) Update lock file * [`caaeeb9`](postcss/postcss@caaeeb9) Upgrade nanoid to fix infinite loop on zero size ([#2124](https://redirect.github.com/postcss/postcss/issues/2124)) * [`3609b6f`](postcss/postcss@3609b6f) Explain how to type plugin options * [`fbad419`](postcss/postcss@fbad419) docs: show ESM and TypeScript plugin declaration ([#2118](https://redirect.github.com/postcss/postcss/issues/2118)) * See full diff in [compare view](postcss/postcss@8.5.25...8.5.26) [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- Dependabot commands and options You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
This pull request includes several changes to the
engine/src/main/java/com/arcadedb/directory, focusing on enhancing theBinary,TransactionContext,DatabaseChecker, andLocalBucketclasses, as well as improving the handling ofMutablePage. The most important changes include adding new methods to handle byte arrays, modifying thecompressPagemethod to include aforceWipeOutparameter, and introducing a newwipeOutFreeSpacemethod.Enhancements to byte array handling:
engine/src/main/java/com/arcadedb/database/Binary.java: Added a newputBytesmethod that allows specifying an index to position the byte array before putting it.engine/src/main/java/com/arcadedb/database/BinaryStructure.java: Added a newputBytesmethod to theBinaryStructureinterface to support the new functionality.Modifications to
compressPagemethod:engine/src/main/java/com/arcadedb/database/TransactionContext.java: Updated calls tocompressPageto include the newforceWipeOutparameter.engine/src/main/java/com/arcadedb/engine/DatabaseChecker.java: Updated thecompressmethod to passtruefor theforceWipeOutparameter when callingcompressPage.Improvements to
LocalBucketclass:engine/src/main/java/com/arcadedb/engine/LocalBucket.java: Added aforceWipeOutparameter to thecompressPagemethod and introduced a newwipeOutFreeSpacemethod to handle page content wiping. [1] [2]deleteRecordInternalandloadMultiPageRecordmethods. [1] [2]Changes to
MutablePageclass:engine/src/main/java/com/arcadedb/engine/MutablePage.java: Introduced a staticZERO_BYTES_ARRAYfor efficient zeroing of byte arrays and updated thewriteZerosmethod to utilize this array for faster operations. [1] [2]