Retry failed snapshot submission - #822
Conversation
| return "", fmt.Errorf("Error - can't upload without valid S3 grant") | ||
| } | ||
|
|
||
| if grant.S3URL == "" && grant.LocalDir != "" { |
There was a problem hiding this comment.
Is LocalDir still in use?
| if testRun { | ||
| requestURL = server.Config.APIBaseURL + "/v2/snapshots/test" | ||
| } else if compact { | ||
| requestURL = server.Config.APIBaseURL + "/v2/snapshots/compact" |
There was a problem hiding this comment.
I dropped this function primarily so that the snapshot UUID and collected timestamp no longer need to be retained. /v2/snapshots/compact is no longer used, but what about /v2/snapshots/test?
|
As discussed, an open question here is whether we should store this in temp files or not - if we can reliably assume that full snapshots are only a handful of MBs in size (which I think is unlikely) it might be fine to stay in memory, otherwise we should utilize temp files (at least when the snapshot is big) to avoid high peak memory use when the server side is temporarily unavailable. We could also consider having a hard limit of how much memory is used across all servers on the collector for this purpose to avoid OOMs, if there is a good reason to not use temp files. |
06b2f9f to
95f6a81
Compare
|
This PR was essentially rewritten. Notable changes:
|
Snapshots are now submitted to a
Queuethat retains recent snapshots if submission fails. This significantly reduces the risk of data loss when there are temporary network connectivity or API availability issues.