Phase 0: fixes from review (torn files, pending blobs, exact sequences, UTF-8, storage checks)

- detect files changing during reading or between resumable steps and
  re-read them (size/mtime/ctime/inode), spike F overwrites mid-run
- drop pending blob ids when a pack or index upload fails
- dump and restore PostgreSQL sequence state exactly, bound parameters,
  validated catalog names; spike C checks all sequences exactly
- keep invalid UTF-8 byte-exact (tagged base64)
- refuse large tables without a primary key
- StorageBackend: check write/flush/close results, validate base path
- user_migration import/export: root paths, intermediate folders,
  partial writes, read errors
- spikes: never touch an existing account, own fixtures, 512M note
This commit is contained in:
2026-10-01 18:58:51 +02:00
parent 06e55b08ea
commit 7b33347dbc
13 changed files with 274 additions and 70 deletions
+5 -4
View File
@@ -3,7 +3,7 @@
declare(strict_types=1);
// Spike E: per-user backup/restore through user_migration with our own export/import classes.
// php -d memory_limit=128M /var/www/html/custom_apps/ng_backup/spikes/05-user-migration.php
// php -d memory_limit=512M /var/www/html/custom_apps/ng_backup/spikes/05-user-migration.php
require '/var/www/html/lib/base.php';
set_exception_handler(null);
@@ -32,11 +32,12 @@ $root = \OCP\Server::get(IRootFolder::class);
$caldav = \OCP\Server::get(CalDavBackend::class);
$carddav = \OCP\Server::get(CardDavBackend::class);
$migration = \OCP\Server::get(UserMigrationService::class);
$uid = 'alice';
$uid = 'ngb-spike-alice';
$principal = 'principals/users/' . $uid;
if ($old = $users->get($uid)) {
$old->delete();
if ($users->userExists($uid)) {
fwrite(STDERR, "User $uid already exists; refusing to touch an existing account.\n");
exit(2);
}
// 1. Test user with files, a calendar event, a contact and profile data.