Skip to content

Commit 09072af

Browse files
fix test
1 parent 5212406 commit 09072af

5 files changed

Lines changed: 13 additions & 8 deletions

File tree

source/s3_auto_ranged_get.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ static bool s_s3_auto_ranged_get_update(
266266
AWS_S3_REQUEST_FLAG_RECORD_RESPONSE_HEADERS |
267267
AWS_S3_REQUEST_FLAG_ALLOCATE_BUFFER_FROM_POOL);
268268
/* Note: our current default logic is to do part 1, discover size and then abort if payload its
269-
* too huge We optimistically reserve part size for it */
269+
* too huge We optimistically reserve part size for it */
270270
request->part_range_start = 0;
271271
request->part_range_end = meta_request->part_size - 1;
272272
++auto_ranged_get->synced_data.num_parts_requested;

source/s3_auto_ranged_put.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -637,6 +637,9 @@ static bool s_s3_auto_ranged_put_update(
637637

638638
s_compute_request_body_size(meta_request, request);
639639

640+
AWS_LOGF_DEBUG(0, "foo %zu %zu %zu", request->content_length,
641+
request->part_range_start, request->part_range_end);
642+
640643
/* If request was previously uploaded, we prepare it to ensure checksums still match,
641644
* but ultimately it gets marked no-op and we don't send it */
642645
request->was_previously_uploaded = request_previously_uploaded;

source/s3_default_buffer_pool.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,6 @@ struct aws_s3_default_buffer_ticket *s_try_reserve_synced(
649649
overall_taken -= buffer_pool->forced_used - max_impact_of_forced_on_limit;
650650
}
651651

652-
AWS_LOGF_DEBUG(0, "foo");
653652
if ((meta.size + overall_taken) <= buffer_pool->mem_limit) {
654653
ticket = aws_mem_calloc(buffer_pool->base_allocator, 1, sizeof(struct aws_s3_default_buffer_ticket));
655654
ticket->size = meta.size;
@@ -663,7 +662,6 @@ struct aws_s3_default_buffer_ticket *s_try_reserve_synced(
663662
} else if (meta.size <= buffer_pool->primary_size_cutoff) {
664663
/* This needs to be smarter. Currently if primary req size is below limit, it will allocate full block,
665664
which can be above limit. */
666-
AWS_LOGF_DEBUG(0, "foo1");
667665
if (meta.size <= buffer_pool->primary_size_min_cutoff) {
668666
ticket->reserved_from = AWS_S3_BUFFER_POOL_RESERVED_FROM_SECONDARY;
669667
buffer_pool->secondary_reserved += meta.size;
@@ -687,7 +685,6 @@ struct aws_s3_default_buffer_ticket *s_try_reserve_synced(
687685
}
688686
}
689687
} else {
690-
AWS_LOGF_DEBUG(0, "foo2");
691688
ticket->reserved_from = AWS_S3_BUFFER_POOL_RESERVED_FROM_SECONDARY;
692689
buffer_pool->secondary_reserved += meta.size;
693690
}

source/s3_meta_request.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1425,8 +1425,13 @@ static int s_s3_meta_request_incoming_headers(
14251425
}
14261426
if (request->part_range_end != object_range_end) {
14271427
/* In the case where the object size is less than the range requested. It must be return the
1428-
* last part to the end of the object. */
1429-
if (object_size != object_range_end + 1 || request->part_range_end < object_range_end) {
1428+
* last part to the end of the object.
1429+
* Note: that when get with part 1 is used we dont know how big the buffer will be. We optimistically allocate
1430+
* part sized buffer, and see if its enough. If its over, the req will get canceled. So in that case skip validation
1431+
* on expected size.
1432+
*/
1433+
if (request->request_tag != AWS_S3_AUTO_RANGE_GET_REQUEST_TYPE_GET_OBJECT_WITH_PART_NUMBER_1 &&
1434+
(object_size != object_range_end + 1 || request->part_range_end < object_range_end)) {
14301435
/* Something went wrong if it's matching. Log the error. */
14311436
AWS_LOGF_ERROR(
14321437
AWS_LS_S3_META_REQUEST,

tests/s3_data_plane_tests.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4131,8 +4131,8 @@ static int s_test_s3_round_trip_default_get_fc_helper(
41314131
.object_path_override = object_path,
41324132
},
41334133
};
4134-
if (algorithm == AWS_SCA_CRC32 || algorithm == AWS_SCA_CRC32C || algorithm == AWS_SCA_CRC64NVME) {
4135-
/* Full object checksums doesn't support SHA or XXHASH. */
4134+
if (algorithm != AWS_SCA_SHA1 && algorithm != AWS_SCA_SHA256) {
4135+
/* Full object checksums doesn't support SHA. */
41364136
put_options.put_options.full_object_checksum = full_object_checksum;
41374137
}
41384138

0 commit comments

Comments
 (0)