Skip to content

Implementing AWS S3 storage engine #97

Closed

Description

@MariamFahmy98

Implementing an AWS S3 storage engine that supports the following commands:

  • backup: It is used to create a backup for a server.
  • restore: It is used to restore a backup from a server.
  • archive: It is used to archive a backup from a server.
  • delete: It is used to delete a backup from a server.
  • retain: It is used to retain a backup from a server.
  • expunge: It is used to expunge a backup from a server.
  • list-backups: It is used to list the backups for a server.

HTTP requests will be sent using libcurl.

Activity

  1. added 6 commits that reference this issue on Oct 15, 2022
  2. jesperpedersen commented on Apr 13, 2024

    @jesperpedersen
    Member

    The worker framework could likely be used for parallel upload

  3. LoayTarek5 commented on Sep 14, 2026

    @LoayTarek5
    Contributor

    Hi @jesperpedersen, can i work on this feature, also maybe i will open forum discussion on it to discuses any related ideas, if it is ok

  4. jesperpedersen commented on Sep 14, 2026

    @jesperpedersen
    Member

    @LoayTarek5 Please, read #1126 and then help expanding the S3 test suite (start with archive)

  5. jesperpedersen commented on Sep 14, 2026

    @jesperpedersen
    Member

    @LoayTarek5 Check increamental backup, and incremental restore as well

  6. LoayTarek5 commented on Sep 15, 2026

    @LoayTarek5
    Contributor

    @jesperpedersen, really thanks for the guidance.
    i tried to read the #1126, and it's proposal also, and also investigate the tests so please correct me if i am wrong.

    i also tried to ran the three areas against storage_engine = s3 locally (Garage, main 0.22.0, PG 17), so i think it worth reporting before writing tests, because what found looks like bugs rather than missing coverage, if i understand correctly.

    Full backup works, so afterwards the local backup dir holds only backup.info, backup.sha512, backup.manifest and empty tblspc_* dirs , the data/ is like pruned.

    Everything below follows from that

    Command Result
    backup (full) works
    s3 restore works, 46MB tree, valid PG_VERSION, global/, backup_label
    restore Error 600
    archive fails (exit 1)
    backup <parent> (incremental) Error 201

    restore: from at file wf_restore.c is the backup's data/; opendir returns NULL at file restore.

    archive: also same the file archive.c calls pgmoneta_restore_backup.

    incremental: the file wf_backup_incremental.c can not open the parent's data/backup_manifest, it needed by the PG17+ protocol,so i think that no chain can be created under s3, and also incremental restore isnot reachable to test.

    i notice another thing that Error 600 is also like misleading here, because carry_out_workflow
    at file restore.c collapses any execute failure into RESTORE_MISSING_LABEL, logged as "No identifier" for a valid label.

  7. jesperpedersen commented on Sep 15, 2026

    @jesperpedersen
    Member
  8. 9 remaining items

  9. LoayTarek5 commented on Sep 22, 2026

    @LoayTarek5
    Contributor

    @shashidhar-bm ok thanks, that makes sense.

    @mahmoudhssnhmmd what are you covering at the moment? maybe a suggestion so we do not overlap, so i take archive and incremental backup/restore, since @jesperpedersen asked me to start there, and you may take any other part.

    happy to adjust if you already started on any of these.

  10. LoayTarek5 commented on Sep 23, 2026

    @LoayTarek5
    Contributor

    @shashidhar-bm while i scoping archive and incremental for S3 i see some findings

    first with storage_engine = local, s3, i noticed that local data/ is kept, so archive and incremental work today, but unnder s3 only, they need the restore fallback i think.
    second MCTF's write_confs() can't emit local, i would suggest a flag that prepends local, over a no-op driver, which i think would leak into mctf_se_up_all() and break test_remote.c's prune check, right? what do you think?

    also i found bug under local, s3, s3 restore deletes the local <label>/data/ try to see s3.c file at around 339-340 line:

    restore primary F current /tmp/r1  -> ok
    s3 restore primary F /tmp/r2       -> ok, F/data/ gone
    restore primary F current /tmp/r3  -> Error 600
    archive primary F /tmp/a1          -> fails (#1311 adds the response)
    backup primary F                   -> Error 201
    

    it also overwrites the local backup.info with the S3 copy, which has BACKUP=0 and ELAPSED=0.

    so should i open a separate issue for this, or is it part of the restore rework?

  11. mahmoudhammadhm commented on Sep 23, 2026

    @mahmoudhammadhm
    Contributor

    Hi @LoayTarek5, just to clarify, you can definitely work on this. I’m not working on the archive/incremental part itself.

    At the moment, I’m working on the S3 testing side, mainly expanding the S3 test coverage and adding test cases around the existing S3 functionality. You can also check my fork to see the tests I’ve been working on, so we can avoid any overlap.

  12. LoayTarek5 commented on Sep 28, 2026

    @LoayTarek5
    Contributor

    Hi @shashidhar-bm and @Amr-Shams, i have a question beside the above ones, on list-backups: with storage_engine = s3, BackupSize is always 0.

    so the size is read in backup.c file, after the local data/ is already deleted, and with local, s3 the size is correct (11853824), and this also affects status, info and the metrics, i noticed #1052 moves this code, but it still reads the size too late.

    so should we read the size before the remote step? i can work on this, and add list-backup checks to the S3 tests.

  13. added 7 commits that reference this issue on Oct 8, 2026
  14. added 2 commits that reference this issue on Nov 8, 2026
  15. added a commit that references this issue on Nov 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions