-
Notifications
You must be signed in to change notification settings - Fork 11
Split the metadata API request when it hits a limit by count or byte size #129
Split the metadata API request when it hits a limit by count or byte size #129
Conversation
2eb3b98 to
c54b554
Compare
c54b554 to
4f83350
Compare
ACEmilG
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks mostly good, however I do wonder about making this configurable above 1k. Given that there is a limit on the server-side, should we enforce this limit on the client? ie the limit is min(1k, configuration)
| "v1beta2/projects/{{project_id}}/resourceMetadata:batchUpdate", | ||
| config.MetadataIngestionEndpointFormat()); | ||
| EXPECT_EQ(8*1024*1024, config.MetadataIngestionRequestSizeLimitBytes()); | ||
| EXPECT_EQ(1000, config.MetadataIngestionRequestSizeLimitCount()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please also add a check in the PopulatedConfig test for the non-default case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
src/reporter.cc
Outdated
| continue; | ||
| } | ||
| if (total_size + size > limit_bytes) { | ||
| if (entries.size() > limit_count || total_size + size > limit_bytes) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm confused by this line. Seems like we're already violating these bounds no? Unless SendMetadataEntry does some special batching.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you are right, there should be an equality here since the count does not include the latest entry. Updated.
7012443 to
8d66b62
Compare
dhrupadb
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👌
ACEmilG
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
No description provided.