MongoDBJira系列-3.0.5修復的那些事兒

eshujiushiwo發表於2016-01-06

大家好,我是E叔。
經常有朋友向我諮詢版本選型的問題。
受到老畢同學的啟發,E叔決定為大家搬運+翻譯+簡單解釋 MongoDB3.0.4+以後各個版本fixed的比較重要的jira issues。大家可以根據需求來決定版本選型。
今天是3.0.5篇。

Issues fixed in 3.0.5

以下均是3.0.5中修復了的jira issues。(比較重要的issues)
由於人肉整理,難免有遺漏,歡迎補充。

Issues fixed in 3.0.5

SERVER-19513

truncate 一個capped 表的時候 可能其索引在WT中不會刪除。

cover index 的查詢可能就會返回出這些沒刪除的索引的documents

SERVER-19375

選擇syncsource的時候,此前是比較的最新的資料,應該比較最新oplog資料。

SERVER-19189(與SERVER-18829有關聯)

提高了WT引擎在大量threads下的效能。

SERVER-18829

當在WT中進行大量index的建立的時候,會超過我們WT設定的最大cache,可能會OOM之類

SERVER-19178

由於WT tracks和expires capped表的方式問題,效能有所損耗(在大量inserts的情況,)

注意:oplog就是個capped collection!

現在WT會cache住capped的第一個沒有過期的document在cache中,提高了效率。

SERVER-18994

producer thread can continue producing after a node becomes primary

SERVER-18926

full text search 在WT中效率很低,使用記憶體較多

yield過程中 intermediate的資料buffer在cache中,但是在$text 和geoNear的long queries有個bug:

In particular, if a such a query yields y times and buffers d documents, the overall time spent in yield-preparation was O(yd). With the fix, the time complexity is reduced to O(y).

SERVER-18902

超過1MB大小的document,WT速度slow down

原因如下

WiredTiger does not store documents larger than its default leaf_value_max in the in-memory cache. The leaf_value_max value is 1 megabyte. As a result, operations that read or modify larger documents are significantly less efficient than with smaller documents.

Starting with MongoDB 3.0.5 all documents are stored in the in-memory WritedTiger cache, but this change only impacts collections created after upgrading to 3.0.5 or later. Existing collections are unaffected by this change.

WT的每個leaf的leaf_value_max是1MB,如果超過1MB就儲存多個,這時候效率變差。

Users with documents larger than 1 megabyte may use the –wiredTigerCollectionConfigString `leaf_value_max=`configuration option to increase the value of leaf_value_max beyond 1 megabyte to improve performance when accessing large documents.

For example, to ask WiredTiger to put in its cache documents of up to 16 megabytes in size, use:

–wiredTigerCollectionConfigString `leaf_value_max=16000000`

Note that this setting only impacts collections created after the change. Existing collections are not be affected by this change, so users with existing collections containing large documents may want to move them to a newly created collection, replicate them to new instances running 3.0.5, or perform a dump + restore cycle on these collections.

3.0.5修復,但是隻有在3.0.5之後建立的表才有效,可以重新建立表,匯入資料之類。

SERVER-18838

當意外當機(如斷電)的時候,

這些操作:database creation

database dropping

collection creation

collection dropping

index creation

index dropping

將可能會作用在invalid的data set中,導致重啟後recover失敗

SERVER-17386

WT 不限制mongo開啟的wt session。這樣造成了一定的記憶體洩露

WiredTiger allows MongoDB to open an unbounded number of WiredTiger sessions, which means that despite a limited number of WiredTiger cursors per session, the total number of cached sessions an cursors may lead to excessive memory use.


相關文章