-
Notifications
You must be signed in to change notification settings - Fork 226
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Swing-store export should have a "replay" artifact level #8105
Comments
We estimate that this will grow the state-sync snapshot data size (sum of the compressed chunks that a new validator must download) from 335MB to 700-ish MB. The time to generate the snapshot will grow too (maybe double, maybe more.. my follower node took 3-4min to generate the 335MB one, @mhofman 's took 15min to generate the 700MB one, but they're on different hardware). That also increases the time to download and decompress. I'm thinking Would we want that for all the levels? E.g. would I suppose one approach would be to have two args/options, one for the maximum level (behaving like the old If we do that, I'd probably want to change the second argument to an options bag (perhaps with backwards compatibility for a single string). And then I guess the option names would be |
Yes
No, I was thinking it could enforce 'archival', but that's not necessary. See what I wrote here https://github.com/Agoric/agoric-sdk/pull/8143/files#diff-165a82d94d7114e699229abed73f9f5739be922caa7bafb8a44aff5930c31d2bR28-R33:
I think we should not overcomplicate this. I called it a level as I was thinking about it in term of enforced level of data I want in the export (or import). I don't see a reason to have "at least this but maybe give me this much more". We can tack on a 'debug' that doesn't enforce anything and just dumps everything if needed.
I sure hope we do that regardless of the shape. The less positional params, the best |
@mhofman and I just settled on
However We're changing the old positional If I have time, I'll also add some short command-line tools, maybe in Implementation notes:
|
The
No need, that's what
First part is what the export tool already does. Second part is up to the user, they just need to provide a directory to the import tool (as options)
Import tool already "supports" this combination, but just throws since it has nothing to call. I can go either standalone or |
Ah, yeah, I was only talking about export failing. For sure any import can fail for a variety of reasons. I can make
Awesome, less work for me :).
Yeah, I think concurrent repopulation would make it easier to use (don't need to halt your validator while you do the repopulation), but it can wait for another day. |
Previously, `makeSwingStoreExporter()` took a positional argument named `exportMode`, with values of 'current', 'archival', or 'debug'. This controlled how many artifacts were included in the export, on a best-effort basis (e.g. a DB whose old spans were pruned would emit the same artifacts with either 'current' or 'archival'). `importSwingStore()` took an options bag with both the `makeSwingStore` options (like `keepSnapshots` and `keepTranscripts`), and an import-specific `includeHistorical` boolean, which controlled which artifacts were processed by the import. This was also on a best-effort basis: `includeHistorical: true` on an export dataset that lacked old spans would produce the same (pruned) DB as `false`. This commit changes both APIs to take an options bag with a common `artifactMode` option, with values of `operational`, `replay`, `archival`, or `debug`. The `operational` choice replaces `current` and behaves the same way: just enough data for normal operations. The new `replay` choice 'operational' and 'archival', and selects all transcript spans for the current incarnation of each vat, but omits transcript spans for old incarnations: enough to perform a full vat-replay of the latest incarnation. Note: `makeSwingStoreExporter` was changed from a positional argument to an options bag, and no attempt was made to be compatible with old-style callers. During export, the mode is now strict: if the DB lacks the artifacts requested by the given mode, `makeSwingStoreExporter()` will throw an error, rather than emit fewer artifacts than desired. This means `artifactMode: 'replay'` will fail unless the DB being exported has all those old (current-incarnation) transcript items. And `archival` will fail unless the DB has the old incarnation spans too. The `debug` mode is best-effort, and emits everything available without the additional completeness checks. During import, the mode applies both an import filter and a completeness check. So exporting with `archival` but importing with `operational` will get you a pruned DB, lacking anything historical. Exporting with `operational` and importing with `replay` or `archival` will fail, because the newly-populated DB does not contain any historical artifacts. closes #8105
Previously, `makeSwingStoreExporter()` took a positional argument named `exportMode`, with values of 'current', 'archival', or 'debug'. This controlled how many artifacts were included in the export, on a best-effort basis (e.g. a DB whose old spans were pruned would emit the same artifacts with either 'current' or 'archival'). `importSwingStore()` took an options bag with both the `makeSwingStore` options (like `keepSnapshots` and `keepTranscripts`), and an import-specific `includeHistorical` boolean, which controlled which artifacts were processed by the import. This was also on a best-effort basis: `includeHistorical: true` on an export dataset that lacked old spans would produce the same (pruned) DB as `false`. This commit changes both APIs to take an options bag with a common `artifactMode` option, with values of `operational`, `replay`, `archival`, or `debug`. The `operational` choice replaces `current` and behaves the same way: just enough data for normal operations. The new `replay` choice 'operational' and 'archival', and selects all transcript spans for the current incarnation of each vat, but omits transcript spans for old incarnations: enough to perform a full vat-replay of the latest incarnation. Note: `makeSwingStoreExporter` was changed from a positional argument to an options bag, and no attempt was made to be compatible with old-style callers. During export, the mode is now strict: if the DB lacks the artifacts requested by the given mode, `makeSwingStoreExporter()` will throw an error, rather than emit fewer artifacts than desired. This means `artifactMode: 'replay'` will fail unless the DB being exported has all those old (current-incarnation) transcript items. And `archival` will fail unless the DB has the old incarnation spans too. The `debug` mode is best-effort, and emits everything available without the additional completeness checks. During import, the mode applies both an import filter and a completeness check. So exporting with `archival` but importing with `operational` will get you a pruned DB, lacking anything historical. Exporting with `operational` and importing with `replay` or `archival` will fail, because the newly-populated DB does not contain any historical artifacts. closes #8105
Previously, `makeSwingStoreExporter()` took a positional argument named `exportMode`, with values of 'current', 'archival', or 'debug'. This controlled how many artifacts were included in the export, on a best-effort basis (e.g. a DB whose old spans were pruned would emit the same artifacts with either 'current' or 'archival'). `importSwingStore()` took an options bag with both the `makeSwingStore` options (like `keepSnapshots` and `keepTranscripts`), and an import-specific `includeHistorical` boolean, which controlled which artifacts were processed by the import. This was also on a best-effort basis: `includeHistorical: true` on an export dataset that lacked old spans would produce the same (pruned) DB as `false`. This commit changes both APIs to take an options bag with a common `artifactMode` option, with values of `operational`, `replay`, `archival`, or `debug`. The `operational` choice replaces `current` and behaves the same way: just enough data for normal operations. The new `replay` choice 'operational' and 'archival', and selects all transcript spans for the current incarnation of each vat, but omits transcript spans for old incarnations: enough to perform a full vat-replay of the latest incarnation. Note: `makeSwingStoreExporter` was changed from a positional argument to an options bag, and no attempt was made to be compatible with old-style callers. During export, the mode is now strict: if the DB lacks the artifacts requested by the given mode, `makeSwingStoreExporter()` will throw an error, rather than emit fewer artifacts than desired. This means `artifactMode: 'replay'` will fail unless the DB being exported has all those old (current-incarnation) transcript items. And `archival` will fail unless the DB has the old incarnation spans too. The `debug` mode is best-effort, and emits everything available without the additional completeness checks. During import, the mode applies both an import filter and a completeness check. So exporting with `archival` but importing with `operational` will get you a pruned DB, lacking anything historical. Exporting with `operational` and importing with `replay` or `archival` will fail, because the newly-populated DB does not contain any historical artifacts. closes #8105
Previously, `makeSwingStoreExporter()` took a positional argument named `exportMode`, with values of 'current', 'archival', or 'debug'. This controlled how many artifacts were included in the export, on a best-effort basis (e.g. a DB whose old spans were pruned would emit the same artifacts with either 'current' or 'archival'). `importSwingStore()` took an options bag with both the `makeSwingStore` options (like `keepSnapshots` and `keepTranscripts`), and an import-specific `includeHistorical` boolean, which controlled which artifacts were processed by the import. This was also on a best-effort basis: `includeHistorical: true` on an export dataset that lacked old spans would produce the same (pruned) DB as `false`. This commit changes both APIs to take an options bag with a common `artifactMode` option, with values of `operational`, `replay`, `archival`, or `debug`. The `operational` choice replaces `current` and behaves the same way: just enough data for normal operations. The new `replay` choice 'operational' and 'archival', and selects all transcript spans for the current incarnation of each vat, but omits transcript spans for old incarnations: enough to perform a full vat-replay of the latest incarnation. Note: `makeSwingStoreExporter` was changed from a positional argument to an options bag, and no attempt was made to be compatible with old-style callers. During export, the mode is now strict: if the DB lacks the artifacts requested by the given mode, `makeSwingStoreExporter()` will throw an error, rather than emit fewer artifacts than desired. This means `artifactMode: 'replay'` will fail unless the DB being exported has all those old (current-incarnation) transcript items. And `archival` will fail unless the DB has the old incarnation spans too. The `debug` mode is best-effort, and emits everything available without the additional completeness checks. During import, the mode applies both an import filter and a completeness check. So exporting with `archival` but importing with `operational` will get you a pruned DB, lacking anything historical. Exporting with `operational` and importing with `replay` or `archival` will fail, because the newly-populated DB does not contain any historical artifacts. closes #8105
Previously, `makeSwingStoreExporter()` took a positional argument named `exportMode`, with values of 'current', 'archival', or 'debug'. This controlled how many artifacts were included in the export, on a best-effort basis (e.g. a DB whose old spans were pruned would emit the same artifacts with either 'current' or 'archival'). `importSwingStore()` took an options bag with both the `makeSwingStore` options (like `keepSnapshots` and `keepTranscripts`), and an import-specific `includeHistorical` boolean, which controlled which artifacts were processed by the import. This was also on a best-effort basis: `includeHistorical: true` on an export dataset that lacked old spans would produce the same (pruned) DB as `false`. This commit changes both APIs to take an options bag with a common `artifactMode` option, with values of `operational`, `replay`, `archival`, or `debug`. The `operational` choice replaces `current` and behaves the same way: just enough data for normal operations. The new `replay` choice 'operational' and 'archival', and selects all transcript spans for the current incarnation of each vat, but omits transcript spans for old incarnations: enough to perform a full vat-replay of the latest incarnation. Note: `makeSwingStoreExporter` was changed from a positional argument to an options bag, and no attempt was made to be compatible with old-style callers. During export, the mode is now strict: if the DB lacks the artifacts requested by the given mode, `makeSwingStoreExporter()` will throw an error, rather than emit fewer artifacts than desired. This means `artifactMode: 'replay'` will fail unless the DB being exported has all those old (current-incarnation) transcript items. And `archival` will fail unless the DB has the old incarnation spans too. The `debug` mode is best-effort, and emits everything available without the additional completeness checks. During import, the mode applies both an import filter and a completeness check. So exporting with `archival` but importing with `operational` will get you a pruned DB, lacking anything historical. Exporting with `operational` and importing with `replay` or `archival` will fail, because the newly-populated DB does not contain any historical artifacts. closes #8105
Previously, `makeSwingStoreExporter()` took a positional argument named `exportMode`, with values of 'current', 'archival', or 'debug'. This controlled how many artifacts were included in the export, on a best-effort basis (e.g. a DB whose old spans were pruned would emit the same artifacts with either 'current' or 'archival'). `importSwingStore()` took an options bag with both the `makeSwingStore` options (like `keepSnapshots` and `keepTranscripts`), and an import-specific `includeHistorical` boolean, which controlled which artifacts were processed by the import. This was also on a best-effort basis: `includeHistorical: true` on an export dataset that lacked old spans would produce the same (pruned) DB as `false`. This commit changes both APIs to take an options bag with a common `artifactMode` option, with values of `operational`, `replay`, `archival`, or `debug`. The `operational` choice replaces `current` and behaves the same way: just enough data for normal operations. The new `replay` choice 'operational' and 'archival', and selects all transcript spans for the current incarnation of each vat, but omits transcript spans for old incarnations: enough to perform a full vat-replay of the latest incarnation. Note: `makeSwingStoreExporter` was changed from a positional argument to an options bag, and no attempt was made to be compatible with old-style callers. During export, the mode is now strict: if the DB lacks the artifacts requested by the given mode, `makeSwingStoreExporter()` will throw an error, rather than emit fewer artifacts than desired. This means `artifactMode: 'replay'` will fail unless the DB being exported has all those old (current-incarnation) transcript items. And `archival` will fail unless the DB has the old incarnation spans too. The `debug` mode is best-effort, and emits everything available without the additional completeness checks. During import, the mode applies both an import filter and a completeness check. So exporting with `archival` but importing with `operational` will get you a pruned DB, lacking anything historical. Exporting with `operational` and importing with `replay` or `archival` will fail, because the newly-populated DB does not contain any historical artifacts. closes #8105
Previously, `makeSwingStoreExporter()` took a positional argument named `exportMode`, with values of 'current', 'archival', or 'debug'. This controlled how many artifacts were included in the export, on a best-effort basis (e.g. a DB whose old spans were pruned would emit the same artifacts with either 'current' or 'archival'). `importSwingStore()` took an options bag with both the `makeSwingStore` options (like `keepSnapshots` and `keepTranscripts`), and an import-specific `includeHistorical` boolean, which controlled which artifacts were processed by the import. This was also on a best-effort basis: `includeHistorical: true` on an export dataset that lacked old spans would produce the same (pruned) DB as `false`. This commit changes both APIs to take an options bag with a common `artifactMode` option, with values of `operational`, `replay`, `archival`, or `debug`. The `operational` choice replaces `current` and behaves the same way: just enough data for normal operations. The new `replay` choice 'operational' and 'archival', and selects all transcript spans for the current incarnation of each vat, but omits transcript spans for old incarnations: enough to perform a full vat-replay of the latest incarnation. Note: `makeSwingStoreExporter` was changed from a positional argument to an options bag, and no attempt was made to be compatible with old-style callers. During export, the mode is now strict: if the DB lacks the artifacts requested by the given mode, `makeSwingStoreExporter()` will throw an error, rather than emit fewer artifacts than desired. This means `artifactMode: 'replay'` will fail unless the DB being exported has all those old (current-incarnation) transcript items. And `archival` will fail unless the DB has the old incarnation spans too. The `debug` mode is best-effort, and emits everything available without the additional completeness checks. During import, the mode applies both an import filter and a completeness check. So exporting with `archival` but importing with `operational` will get you a pruned DB, lacking anything historical. Exporting with `operational` and importing with `replay` or `archival` will fail, because the newly-populated DB does not contain any historical artifacts. closes #8105
What is the Problem Being Solved?
The current export mode of the swing-store exporter allows to include some historical data (
archival
/debug
, or only thecurrent
artifacts.The former are not deterministic as it depends on whether some artifacts were pruned in the past (e.g. through state-sync)
While current artifacts are sufficient for operational purposes today, we know we'll need to replay historical transcript spans of the current incarnation of vats to support major XS upgrades.
We thus need a new deterministic mode that includes such artifacts so that every validator has sufficient data when replaying from state-sync.
Related: #8025 (comment)
Description of the Design
Change the export options to replace the "export mode" option with an "artifact level" option as follow:
current
export level)archival
)debug
)Security Considerations
We should switch state-sync to the
replay
level. Node that have pruned artifacts will fail to create state-sync snapshots until they have repopulated the missing artifacts, however such failures are not consensus affecting.Similarly, genesis export should use that mode, with the same considerations as state-sync.
Scaling Considerations
This will increase the size of state-sync snapshots (and genesis exports). To mitigate we need to restart vats (null upgrade) more often.
Genesis export, and possibly state-sync, suffer from a memory usage issue in cosmos, where all data is held in memory before being written to disk. This could raise the resources necessary to operate such nodes, but as for security considerations, these operations are not part of the normal validating operations.
Test Plan
TBD
Upgrade Considerations
See security considerations. We should provide the ability for validators to re-populate missing artifacts required for the "replay" level.
The text was updated successfully, but these errors were encountered: