Skip to content

Conversation

@qingyang-hu
Copy link
Collaborator

@qingyang-hu qingyang-hu commented Nov 26, 2025

GODRIVER-3704

Summary

  • Fix search index failure on empty "Options".
  • Fix "test-search-index".

Background & Motivation

@github-actions github-actions bot added the review-priority-normal Medium Priority PR for Review: within 1 business day label Nov 26, 2025
@mongodb-drivers-pr-bot
Copy link
Contributor

mongodb-drivers-pr-bot bot commented Nov 26, 2025

🧪 Performance Results

Commit SHA: 1373cf2

The following benchmark tests for version 692dc1709bc46e00075de220 had statistically significant changes (i.e., |z-score| > 1.96):

Benchmark Measurement % Change Patch Value Stable Region H-Score Z-Score
BenchmarkBSONFlatDocumentEncoding ops_per_second_min -92.4445 264.0431 Avg: 3494.7186
Med: 3600.1057
Stdev: 560.3542
0.9064 -5.7654
BenchmarkBSONFullDocumentDecoding ops_per_second_min -49.7155 979.3648 Avg: 1947.6494
Med: 1972.0054
Stdev: 177.1059
0.9031 -5.4673
BenchmarkSmallDocInsertOne total_mem_allocs -23.8450 352205.0000 Avg: 462484.2340
Med: 474042.0000
Stdev: 28658.5350
0.8618 -3.8480
BenchmarkSmallDocInsertOne total_bytes_allocated -22.6150 27344752.0000 Avg: 35335995.2340
Med: 36189640.0000
Stdev: 2253823.4070
0.8489 -3.5456
BenchmarkSmallDocInsertOne ns_per_op 14.4489 218025.0000 Avg: 190499.8723
Med: 186014.0000
Stdev: 12010.5408
0.7723 2.2917
BenchmarkLargeDocInsertOne total_mem_allocs -14.1982 398736.0000 Avg: 464717.3191
Med: 474632.0000
Stdev: 27622.9577
0.7732 -2.3886
BenchmarkLargeDocInsertOne total_bytes_allocated -12.6777 31002928.0000 Avg: 35504036.7660
Med: 36091016.0000
Stdev: 2203157.8973
0.7344 -2.0430
BenchmarkSmallDocInsertOne total_time_seconds -11.5051 1.0478 Avg: 1.1841
Med: 1.1847
Stdev: 0.0243
0.9056 -5.6084
BenchmarkSmallDocInsertOne ops_per_second_med -11.4011 5004.2661 Avg: 5648.2271
Med: 5671.6029
Stdev: 225.9093
0.8088 -2.8505
BenchmarkLargeDocInsertOne total_time_seconds -9.0856 1.0746 Avg: 1.1820
Med: 1.1816
Stdev: 0.0236
0.8784 -4.5550
BenchmarkSmallDocInsertOne ops_per_second_max -8.7487 5672.1176 Avg: 6215.9301
Med: 6245.5500
Stdev: 211.8155
0.7911 -2.5674
BenchmarkBSONDeepDocumentEncoding ops_per_second_med 8.1767 78369.9060 Avg: 72446.1794
Med: 71795.2734
Stdev: 2605.4418
0.7617 2.2736
BenchmarkBSONDeepDocumentEncoding ops_per_second_max 7.3276 81592.6893 Avg: 76022.1212
Med: 75346.7180
Stdev: 2421.0878
0.7659 2.3009
BenchmarkBSONDeepDocumentEncoding total_time_seconds -2.4968 1.1650 Avg: 1.1948
Med: 1.1946
Stdev: 0.0085
0.8542 -3.4942

For a comprehensive view of all microbenchmark results for this PR's commit, please check out the Evergreen perf task for this patch.

@mongodb-drivers-pr-bot
Copy link
Contributor

API Change Report

No changes found!

@qingyang-hu qingyang-hu force-pushed the godriver3704 branch 5 times, most recently from 1c96085 to ee65456 Compare November 26, 2025 23:07
Comment on lines -29 to -33
assume-test-secrets-ec2-role:
- command: ec2.assume_role
params:
role_arn: ${aws_test_secrets_role}

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Duplicate of L175

@qingyang-hu qingyang-hu marked this pull request as ready for review November 26, 2025 23:55
@qingyang-hu qingyang-hu requested a review from a team as a code owner November 26, 2025 23:55
Copilot AI review requested due to automatic review settings November 26, 2025 23:55
Copilot finished reviewing on behalf of qingyang-hu November 26, 2025 23:57
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a bug where search index creation failed when SearchIndexModel.Options is nil. The fix ensures that the document element is always started before checking for optional fields.

Key changes:

  • Moved AppendDocumentElementStart call outside the Options != nil check to ensure proper BSON document construction
  • Added integration test to verify search index creation with empty options
  • Standardized environment variable naming from TEST_INDEX_URI to SEARCH_INDEX_URI

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
mongo/search_index_view.go Fixed bug by moving AppendDocumentElementStart before the Options != nil check, ensuring proper BSON document structure regardless of Options value
internal/integration/search_index_test.go Added new integration test to verify search index creation with empty Options
internal/integration/search_index_prose_test.go Updated environment variable name from TEST_INDEX_URI to SEARCH_INDEX_URI for consistency
Taskfile.yml Updated test runner to execute both TestSearchIndex and TestSearchIndexProse tests
.evergreen/config.yml Updated environment variable naming to SEARCH_INDEX_URI and removed duplicate assume-test-secrets-ec2-role function definition

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@qingyang-hu qingyang-hu marked this pull request as draft December 1, 2025 14:54
@qingyang-hu qingyang-hu marked this pull request as ready for review December 1, 2025 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug review-priority-normal Medium Priority PR for Review: within 1 business day

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant