-
Type:
Improvement
-
Resolution: Fixed
-
Priority:
Major - P3
-
Affects Version/s: None
-
Component/s: Change streams
-
None
-
Query Execution
-
Fully Compatible
-
QE 2026-02-16
-
None
-
None
-
None
-
None
-
None
-
None
-
None
Recently the new oplog entry types ci, cd and km have been added.
Whenever a new oplog entry type is added, this requires work in the change streams event transformer. The event transformer will throw an "unsupported oplog entry type" error in case it encounters an unknown oplog entry type.
Also the change streams filter will need to be adjusted when adding a new oplog entry type.
To make other teams aware of this necessity, we should add a static_assert in the change streams code that verifies that the number of current oplog entry type enum values is as expected.
When a new value is then added to the oplog entry type enum, the static_assert will fail and thus make other teams aware of the necessity.
This is not perfect, but is better than not being aware of any issues.
We can use this declaration from oplog_entry_gen.h to check for number of expected oplog entry types in the static_assert:
template<> constexpr inline size_t idlEnumCount<::mongo::repl::OpTypeEnum> = 8;