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

SNOW-928922 send spansMixedTables flag in blob registration requests #651

Merged
merged 1 commit into from
Dec 18, 2023

Conversation

sfc-gh-gdoci
Copy link
Collaborator

@sfc-gh-gdoci sfc-gh-gdoci commented Nov 14, 2023

This PR add a new field spansMixedTables in BlobMetadata, which is send in the blob registration request.
This flag will be used server-side for optimizations and sanity checks.
After this PR, we want to simplify the retry logic so that the new register blob request has all chunks contained in a blob and attempted previously, not just failed chunks.

Both of these will serve the same goal to have correct flag value server-side. The flag is there in case there is something wrong with retries or we have to revert back to old retry logic.

I'll wait for the server-side change to be deployed before merging this PR.

@sfc-gh-gdoci sfc-gh-gdoci requested review from sfc-gh-tzhang and a team as code owners November 14, 2023 15:14
Copy link
Contributor

@sfc-gh-tzhang sfc-gh-tzhang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some comments, otherwise LGTM! And I assume the server side change is now rollback safe?

ParameterProvider.BLOB_FORMAT_VERSION_DEFAULT,
chunks,
blobStats,
chunks == null ? false : chunks.size() > 1);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can chunks be null here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, because that constructor is used in tests (only) and RegisterServiceTest calls it with chunks null.

@@ -18,24 +18,33 @@ class BlobMetadata {
private final Constants.BdecVersion bdecVersion;
private final List<ChunkMetadata> chunks;
private final BlobStats blobStats;
private final boolean spansMixedTables;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

want to add a comment explain this? The name is not straight forward like other fields

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or I suggest we call it something like hasMultipleTables

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a comment.

@@ -568,8 +568,15 @@ BlobMetadata upload(
blob.length,
System.currentTimeMillis() - startTime);

// at this point we know for sure if the BDEC file has data for more than one chunk, i.e.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit

Suggested change
// at this point we know for sure if the BDEC file has data for more than one chunk, i.e.
// At this point we know for sure if the BDEC file has data for more than one chunk, i.e.

@sfc-gh-gdoci
Copy link
Collaborator Author

And I assume the server side change is now rollback safe?

Yeah, it will work with old SDKs. The default value server-side if the flag is missing is true.

@sfc-gh-gdoci sfc-gh-gdoci force-pushed the gdoci-SNOW-928922-spans-mixed-tables-flag branch from 9b53126 to 31612e9 Compare December 18, 2023 09:53
@sfc-gh-gdoci sfc-gh-gdoci merged commit e140aa7 into master Dec 18, 2023
12 checks passed
@sfc-gh-gdoci sfc-gh-gdoci deleted the gdoci-SNOW-928922-spans-mixed-tables-flag branch December 18, 2023 15:42
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.

3 participants