1. 程式人生 > >Redis 6.0.8 緊急釋出,請儘快升級!

Redis 6.0.8 緊急釋出,請儘快升級!

大家週末愉快啊,今天分享一則重要通知。 Redis 6.0.8 於 2020/9/10 日晚緊急釋出!!! ![](https://img2020.cnblogs.com/other/1218593/202009/1218593-20200912120020412-1876097140.png) 可以看到這是一個緊急更新版本,使用了 Redis 6.0.7 Sentinel(哨兵)以及 `CONFIG REWRITE` 命令的使用者受到影響,請儘快升級,參考問題:#7760。 > https://github.com/redis/redis/issues/7760 ![](https://img2020.cnblogs.com/other/1218593/202009/1218593-20200912120020734-885824427.png) Redis 6.0.8 釋出郵件: > https://groups.google.com/g/redis-db/c/Wmf0RB25PmY/m/d7hVkerfBQAJ 以下是主要內容預覽: ![](https://img2020.cnblogs.com/other/1218593/202009/1218593-20200912120021006-926190537.png) 難道 Redis 出現了嚴重漏洞不成?棧長來解讀一下這封郵件內容! 除了以上提到的受影響的內容之外,還有以下三方面的更新: **1、問題修復:** - 通過 Redis 的 `CONFIG SET` 命令設定 `oom-score-adj-values` 引數值,或者通過在配置檔案中載入的時候,將生成一個損壞的配置檔案導致 Redis 啟動失敗;(好吧!不是漏洞,是 Redis 的一個 bug 而已!) - 修改 MacOS 系統下一個 `redis-cli --pipe` 使用問題; - 修復了當不存在的鍵時,使用 `HKEYS/HVALS` 命令的響應問題; - 其他各種小錯誤的修復; **2、新特性/改變** - 移除設定 madvise 時的 THP 警告; - 允許在叢集的只讀副本上執行讀取命令; - 為 `redis-cli --cluster` 命令增加 `masters/replicas` 選項; **3、模組API** - 增加 `RedisModule_ThreadSafeContextTryLock` 模組(執行緒安全的鎖); **重點來看一下這個導致重大問題的 `oom-score-adj-values` 引數的用處:** > https://github.com/redis/redis/pull/1690/files ``` ############################ KERNEL OOM CONTROL ############################## # On Linux, it is possible to hint the kernel OOM killer on what processes # should be killed first when out of memory. # # Enabling this feature makes Redis actively control the oom_score_adj value # for all its processes, depending on their role. The default scores will # attempt to have background child processes killed before all others, and # replicas killed before masters. oom-score-adj no # When oom-score-adj is used, this directive controls the specific values used # for master, replica and background child processes. Values range -1000 to # 1000 (higher means more likely to be killed). # # Unprivileged processes (not root, and without CAP_SYS_RESOURCE capabilities) # can freely increase their value, but not decrease it below its initial # settings. # # Values are used relative to the initial value of oom_score_adj when the server # starts. Because typically the initial value is 0, they will often match the # absolute values. oom-score-adj-values 0 200 800 ``` 這個 `oom-score-adj` 引數是用來 Linux 核心控制調優的,在 Linux 系統中,當記憶體溢位時,可以提示核心 OOM killer 應該首先殺死哪些程序。 預設 `oom-score-adj-values` 不設定的情況下會優先殺死後臺子程序,然後主從節點優先優先殺死從節點。 所以這 3 個值分別用來設定主、從、後臺子程序的分值的,分值範圍從 -1000 ~ 1000,分值越高越有可能被先殺死。 **PS:** 軟體嘛,總避免不了bug,所以,各位開發、運維的同學,如果有用到這個的,請儘快升級保平安。 最後,歡迎大家關注微信公眾號:Java技術棧,可以閱讀棧長我寫的往期 Redis 系列教程,後續更多幹貨陸續奉上。 覺得有用,歡迎在看、轉發支援下,感謝了! **近期熱文推薦:** 1.[免費獲取 IntelliJ IDEA 啟用碼的 6 種方式!](http://www.javastack.cn/article/2020/intellij-idea-active-six-ways/) 2.[我用 Java 8 寫了一段邏輯,同事直呼看不懂,你試試看。。](http://www.javastack.cn/article/2020/java-8-optional-map-do-you-know/) 3.[吊打 Tomcat ,Undertow 效能很炸!!](http://www.javastack.cn/article/2020/undertow-introduce-with-spring-boot/) 4.[國人開源了一款超好用的 Redis 客戶端,真香!!](http://www.javastack.cn/article/2020/another-redis-desktop-manager/) 5.[《Java開發手冊(嵩山版)》最新發布,速速下載!](http://www.javastack.cn/article/2020/alibaba-release-java-develop-rules-songshan/) 覺得不錯,別忘了隨手點贊+轉