Skip to content
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

Snapshot IDs #63

Merged
merged 2 commits into from
Feb 7, 2022
Merged

Snapshot IDs #63

merged 2 commits into from
Feb 7, 2022

Conversation

radekg
Copy link
Owner

@radekg radekg commented Feb 7, 2022

Per: https://yugabyte-db.slack.com/archives/CG0KQF0GG/p1644257955047349?thread_ts=1643868640.696389&cid=CG0KQF0GG

Please interpret the resp.snapshot_id() as an array of 16 bytes. And nothing more. (Not md5/base64/etc.) 16 bytes. Each byte value is in: 0x00 - 0xFF range.

In C++ code the decoding only checks the string size and do memcpy:

Uuid Uuid::TryFullyDecode(const Slice& slice) {
	if (slice.size() != boost::uuids::uuid::static_size()) {
		return Uuid::Nil();
	}
	Uuid id;
	memcpy(id.data(), slice.data(), boost::uuids::uuid::static_size());
	return id;
}

Per: https://yugabyte-db.slack.com/archives/CG0KQF0GG/p1644258454859919?thread_ts=1643868640.696389&cid=CG0KQF0GG

Just because the Snapshot ID for non-transaction-aware-snapshot (old snapshot when "transaction_aware=false" - not used now) was passed through the same PB field. So, in the code "32-bytes string" = old non-transactional snapshot UUID as a string. "16 bytes" = new transactional snapshot id in binary form. So.. two-in-one.. it's the reason of the complexity. Sorry.

As the old (non-transactional) snapshots are not used more, you can always expect the 16 bytes.

The case is only for Snapshot ID.

Namespace/Table/Tablet ID is a UUID in simple string form. No such complexities.

@radekg radekg merged commit a460f02 into master Feb 7, 2022
@radekg radekg deleted the snapshot-ids branch February 7, 2022 19:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant