-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
v1.3: Bigtable inner transaction plumbing is incompatible with v1.2 #12494
Comments
To prevent this from accidentally occurring again, the |
@mvines the whole point of option wrapping |
I think |
Got it, fiddling with this now |
Here's some easy STR:
Works on v1.2 but master dies with:
|
This all comes down to our over-reliance on At this point it's difficult to differentiate an old The same issue happens to blockstore. Deserialization will fail when using the
By the way, this is actually not an issue because old code will ignore extra fields as long as they are added at the end of the struct. |
Does this feel ok? It would allow us to continue appending new fields #[derive(Debug, Serialize, Deserialize)]
struct Test {
pub field: u64,
#[serde(deserialize_with = "default_on_eof")]
pub inner: Option<Inner>,
}
fn default_on_eof<'de, T, D>(d: D) -> Result<Option<T>, D::Error> where D: Deserializer<'de>, T: Deserialize<'de> {
let result = Option::<T>::deserialize(d);
match result {
Err(err) if err.to_string() == "io error: unexpected end of file" => {
Ok(None)
},
result => result,
}
} |
Yep this seems pretty nice to me. Better than wrapping the struct in a versioned enum and a bunch of conversion code. It'd be nice to check the actual error instead of checking |
Ah, I see... Thanks for the detail, @jstarry ! |
|
I think the only option is using a known slot to switch to a new versioned or tagged format. |
I just dug a bit into the BigTable code and it looks like we could switch over to a new "CellName" for versioned binary data. Instead of "bin", something like "vbin" could work I think. For versioned binary data we could bite the bullet and switch to protobuf/capnproto or use an enum / add a version number to structs going forward |
My plan is to switch to protobuf to enable more future proof, but still compact data storage in bigtable. I'll add a new cell name called "proto" which will hold the protobuf serialized data. When fetching confirmed blocks, v1.3 code will check first for "proto" but will fall back to "bin" for older blocks. v1.2 code will not know anything about "proto" so we just need to make sure that warehouse nodes are not updated before api nodes. Rather than add a build script which will require everyone to install |
FYI I just created a draft PR for what the implementation could look like at #12526 |
I'm pretty sure that the new field added to
StoredConfirmedBlockTransactionStatusMeta
here:solana/storage-bigtable/src/lib.rs
Line 165 in 179dd6e
will break the deserialization of existing
StoredConfirmedBlock
entries in BigTable:solana/storage-bigtable/src/lib.rs
Lines 76 to 89 in 179dd6e
It's impractical to reprocess the existing BigTable transaction contents, so we'll need two versions of
StoredConfirmedBlockTransactionStatusMeta
/StoredConfirmedBlock
in the v1.3 branch. A legacy version for existing data, and the current version.The text was updated successfully, but these errors were encountered: