Repository navigation
[#524] Incremental backup restore size calculation - #590
Conversation
0d2eb3a to
97d5199
Compare
|
@Jubilee101, @jesperpedersen I have made the desired changes, PTAL Thanks |
|
@Jubilee101, Done |
|
Looking good, can you restore an incremental backup and verify its size? |
|
Encountering this error again and again Don't think it has something to do with our backup size calculation infra |
|
Can you log the errno message? |
No such file or directory |
|
Restore is working with base backups though |
Hmm, that is odd. And postgresql.conf is present in your backup 20250411011348? |
|
Does your postgres server have postgres.conf in the first place? This feels off, I'm not 100% sure, but postgres.conf seems to be a must-have. I'm curious why you don't have it. |
The |
|
@ashu3103 How did you do the |
I really can't recall how I did it initially, I am initializing new cluster |
|
@ashu3103 You forgot |
Thanks, I'll add that flag. |
|
@ashu3103 No, we work towards production level installations - the documentation should reflect that as a minimum |
Yeah, got your point! |
|
The calculated backup size: Any more tests we have to run? |
|
Apart from |
Okay!
If we place |
|
We have to break it down, and maybe the higher level API is just a wrapper for a lower level one. What are the core functions ? And, move them down, so we don't have dependencies in both directions |
And it shall be. @ashu3103 Can you rebase? Sorry for the mess.
Yes, let's keep it as a static function inside info.c at the moment. It's not used elsewhere anyway. Jesper and I will sort out this circular dependency nightmare in another issue. |
Sure
I think it will still pose some issues (if you define |
Do what you must. We can do bigger refactoring work later. |
Okk Also I had one doubt regarding your latest commit, you have made the functions Or Shall I leave the refactoring work for later |
Ok, what about moving it to a static function in info? |
Yeah that would be fine, since its only used in |
3a8e53b to
5aae8d3
Compare
c140239 to
36de5da
Compare
|
@Jubilee101, @jesperpedersen PTAL |
| * @return 0 on success, 1 if otherwise | ||
| */ | ||
| int | ||
| pgmoneta_backup_size(int server, char* label, unsigned long* size, uint64_t* biggest_file_size); |
There was a problem hiding this comment.
This should be the only change in info.h - so you have to use static for the rest, or a lower level .h
There was a problem hiding this comment.
We discussed about exposing rfile and corresponding APIs in info.h right, please tell me if I am missing something.
There was a problem hiding this comment.
info.h is about the struct backup - so if you can't use rfile as static only, then you need to create a rfile.h file and we can take it from there
There was a problem hiding this comment.
This doesn't change the fact that extract_backup belongs to restore.h. And if you don't want info to include restore, it's a dilemma. The patch looks good enough for me. And I don't see why rfile can't belong to info. It's still header metadata about backup file. Even if you put rfile in rfile.h, you'd still have extract_backup_file that belongs to nowhere. I'd like to merge this patch, and think about how we can rewire things in #592.
|
@ashu3103 It doesn't work when hotstandby is enabled. Free space check is checking the temp directory in workspace that has not been created yet. We use it to store the restored backup temporarily. Make a backup with hotstandby enabled and you'll see. |
|
As a matter of fact, restore could always work on root that hasn't been created. You should check the space after the directory is created. |
|
Merged, thanks for your contribution! |
Work in Progress
The objective is to calculate the approximate restoration size of incremental backup as per backup combine. The idea is to go through all the file entries in the manifest of the backup.
block_lengthusing the functionfind_reconstructed_block_length-> which provides the total blocks in the actual restored file.@Jubilee101, @jesperpedersen PTAL.