-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Not Applicable
-
None
-
Storage Engines
We have two types of stat macros: "regular" and "atomic." While non-atomic variants are more performant, they should be used with caution - only when it's guaranteed that no more than one thread will modify these stats. Examples include single-threaded servers like Eviction, Compaction, Swipe, etc. In all other cases, atomic variants should be used to ensure the correctness of stats.
Some wrong uses may include:
- File IO: __wt_blkcache_read, __posix_file_read_mmap, __posix_file_write, __posix_file_write_mmap, __wti_posix_remap_resize_file.
- __wt_btcur_next, __wt_btcur_prev.
- split functions __split_root, __split_internal, __split_insert, __split_multi.
- memory allocation functions: __wt_calloc, __wt_malloc, __realloc_func, __wt_free_int
- Many others.
Use this regex in your IDE to find all instances of non-atomic stat modification:
\bWT_STAT(P?)_(CONN|DSRC)(_(CONN|DSRC))?_(INCR|DECR|SET)[^_]
Having inconsistent FTDC stats can lead to wrong analysis of the state of the server but we need to prioritise making sure that the most important state are correct:
- The ones mostly used during FTDC analysis.
- The ones used directly in MongoDB.