v0.10.0 - SDAM (legacy)
"Legacy" specification for Server Discovery and Monitoring (SDAM) added, now passing a total of 562 test scenarios.
It also brings performance improvements to multi-threaded and multi-client scenarios.
Highlights
- SDAM Pub/Sub Events: You can now monitor the exact lifecycle of your MongoDB clusters using
client.subscribe_sdam { |event| ... }. - IPv6 & TLS: Fixed parsing bugs on IPv6 literals (e.g.,
[::1]) which would fail OpenSSL certificate hostname validation or shatter the underlyingTCPSocket. - Load Balancer Support: Added native topology states for
LoadBalancedclusters. - Concurrency: Fixed internal synchronization from class-level (
@@) to instance-level (@) locks, allowing multipleMongo::Clientinstances to operate correctly.
Changelog
Added
- sdam: Added the complete SDAM Pub/Sub Event API (
TopologyOpeningEvent,TopologyDescriptionChangedEvent,ServerOpeningEvent,ServerClosedEvent,ServerDescriptionChangedEvent,TopologyClosedEvent). - sdam: Added support for the
LoadBalancedtopology type andLoadBalancerserver type. - testing: Created a dedicated
spec/sdam_runner_spec.crtest runner for the SDAM legacy test suite, passing 100%.
Changed
- performance: Eliminated global class-level locks (
@@) in favor of instance-level locks (@) inMongo::Client. - performance: Restructured
Mongo::Connection::Poolcheckout logic to reduce the scope of locks, preventing thread starvation during network I/O. - testing: Reorganized the spec test folders into
spec/tests/unified/andspec/tests/legacy/.
Fixed
- connection: Fixed IPv6 literal parsing (
[::1]) to safely strip brackets forTCPSocketand TLS certificate validation while preserving them for SDAM string-matching. - sdam: Fixed a bug where
logical_session_timeout_minuteswas not properly cleared when a cluster lost its last data-bearing node. - sdam: Implemented MongoDB 6.0+ staleness tuple comparison (
electionIdtakes precedence oversetVersionon wire versions >= 17). - sdam: Fixed an issue where
ServerClosedEventwas not emitted when a server was evicted from a primary's host list. - sdam: Enforced strict fallback to
Unknownserver types whenever a server responds withok: 0.0. - uri: Corrected URI path decoding