Cluster: atomic update of nodes.conf file.
Cluster: atomic update of nodes.conf file.

The way the file was generated was unsafe and leaded to nodes.conf file
corruption (zero length file) on server stop/crash during the creation
of the file.

The previous file update method was as simple as open with O_TRUNC
followed by the write call. While the write call was a single one with
the full payload, ensuring no half-written files for POSIX semantics,
stopping the server just after the open call resulted into a zero-length
file (all the nodes information lost!).

MSOpenTech/redis,roth1002/redis,itugs/redis,MasahikoSawada/redis,SummonY/redis,josiahcarlson/redis,ErikDubbelboer/redis,kensou97/redis,allengaller/redis,kaushik94/redis,gilala/bjredis,louisliangjun/redis,z-fork/redis,YuraLukashik/redis,supasate/redis,hornen/redis,zy416548283/redis-3.0-annotated,dayuoba/redis,modulexcite/redis,zhcy/redis,jackyan/redis,oranagra/redis,j0hnma/hszredis,wujf/redis,twskipper/redis,guker/redis,july2993/redis,tzq668766/redis-3.0-annotated,YuanZhewei/redis,rogerlz/redis,harrisonfeng/redis,a-pavlov/redis,OmarQunsul/graph-redis,fengshao0907/redis-3.0-annotated,janekmi/redis,adamweixuan/redis-3.0-annotated,pedigree/redis,wuyu201321060203/redis-3.0-annotated,ttuna/msot-redis,h0x91b/redis,MSOpenTech/redis,yybirdcf/learn-redis,soloestoy/redis,badboy/redis,a-pavlov/redis,brg-liuwei/redis,seppo0010/rlite-server,xujunhai1991/redis,xlzhan/redis,kensou97/redis,weizijun/redis,ofirluzon/redis,Sciumo/redis,seppo0010/redis,charsyam/redis,davidradunz/redis,pedigree/redis,guker/redis,RepmujNetsik/redis,nilyang/redis-tdd-annotation,elkingtonmcb/redis,wujf/redis,weizijun/redis,clamoriniere1A/redis,citusdata/redis,YuanZhewei/redis,allengaller/redis,pcarrier/redis,qiyang0221/redis,rouzier/redis,dayuoba/redis,PKRoma/redis,qiyang0221/redis,healerkx/redis,Aliceljm1/redis,vincent-vivian-liu/redis,zhoudayang/redis,haima-zju/redis-3.0-annotated,tanghaodong25/redis,Markgorden/redis,nnog/redis,HunanTV/redis,sunheehnus/redis,yuhc/redis-benchmark-enhanced,seppo0010/rlite-server,ctripcorp/redis,shining-yang/redis,YongMan/redis,ksarch-saas/redis,guker/redis,sunheehnus/redis,ofirluzon/redis,yuzhangjob/redis-3.0-annotated-unstable,ituncle/redis,timothyohare/3rdPartySrc-redis,xujunhai1991/redis,mengyou0304/redis,ncopa/redis,LongXQ/redis,LongXQ/redis,elkingtonmcb/redis,itamarhaber/redis,adamweixuan/redis-3.0-annotated,devaos/redis,seandsky/redis,cnbin/redis,supasate/redis,hgl888/redis,AALEKH/redis,shreesundara/redis,gaoxianglong/redis,wbailey5/redis,mumingv/redis-3.0-annotated,devaos/redis,yuhc/redis-benchmark-enhanced,cusspvz/redis,zhiliaoniu/redis,ramonsnir/redis,AplayER/redis,shreesundara/redis,AplayER/redis,izhoujie/redis,mgk/redis,wangyikai/redis,dreamquster/redis,4396/redis,LongXQ/redis,h0x91b/redis,shining-yang/redis,itamarhaber/redis,modulexcite/redis,gilala/redis,mgk/redis,fankeke/redis-3.0-annotated,july2993/redis,seppo0010/redis,HeartSaVioR/redis,hgl888/redis,Wangyao14cyy/redis,ituncle/redis,gilala/bjredis,mingyaaaa/redis,francischan714/redis,harrisonfeng/redis,GrimDerp/redis,ReadCode/redis-3.0-annotated,huyuezheng/redis,twskipper/redis,xuguruogu/redis,fengshao0907/redis,citusdata/redis,LongXQ/redis,MOON-CLJ/redis,ncopa/redis,honestme/redis,supasate/redis,xujunhai1991/redis,xuguruogu/redis,ctripcorp/redis,z-fork/redis,rogerlz/redis,wprice/redis,linfangrong/redis,seandsky/redis,NBSW/redis,mingyaaaa/redis,msn217/redis-3.0-annotated,blackmady/redis,Wangyao14cyy/redis,qiyang0221/redis,cnbin/redis,SyntaxStacks/redis,pmem/redis,j0hnma/hszredis,spinlock/redis,allengaller/redis,shshlzh/redis-3.0-annotated,idning/redis,mingyaaaa/redis,xuguruogu/redis,netroby/redis,splitice/redis,soloestoy/redis,buobao/redis-3.0-annotated,devaos/redis,nnog/redis,Aliceljm1/redis-3.0-annotated,pkdevbox/redis,guker/redis,pkdevbox/redis,davidradunz/redis,a-pavlov/redis,ErikDubbelboer/redis,shshlzh/redis-3.0-annotated,roth1002/redis,GitHubMota/redis,OmarQunsul/graph-redis,soveran/redis,ytjiang/redis,ketor/redis,WorkingOfTimtohyZhang/redis-3.0-annotated,timothyohare/3rdPartySrc-redis,thomasdarimont/redis,mcanthony/redis,neomantra/redis,spearhead-ea/redis,SyntaxStacks/redis,SummonY/redis,jbochi/redis,ipmobiletech/redis,seandsky/redis,darksideofthemoo/redis-histogram,pmem/redis,yuhc/redis-benchmark-enhanced,gechong/redis-3.0-annotated,jacklee0810/redis-3.0-annotated,magastzheng/redis-3.0-annotated,mengyou0304/redis,duanx/redis,HunanTV/redis,himoca/redis,hawkchch/redis,programmecat/redis,vincent-vivian-liu/redis,simplestbest/redis,jingjidejuren/redis,xuzhezhaozhao/redis_reading,blackmady/redis,rrsean/redis-3.0-annotated,StevenTsai/redis,kensou97/redis,nilyang/redis-tdd-annotation,zhaobo1023/redis-3.0-annotated,netroby/redis,colstrom/redis,timothyohare/3rdPartySrc-redis,rogerchina/redis,h0x91b/redis,JoeWoo/redis,StevenTsai/redis,francischan714/redis,spinlock/redis,jacklee0810/redis-3.0-annotated,PKRoma/redis,jxwr/redis,gilala/hredis,xuzhezhaozhao/redis_reading,colstrom/redis,cnbin/redis,unasm/redis-3.0-annotated,charsyam/redis,cusspvz/redis,0x55/redis-3.0-annotated,slfs007/mk-redis,vincent-vivian-liu/redis,Soledad89/redis,ofirluzon/redis,ReadCode/redis-3.0-annotated,valdsJohn/redis,zhiliaoniu/redis,kensou97/redis,riyan8250/redis,oranagra/redis,arijitvt/redis,allengaller/redis,kmiku7/redis,tanghaodong25/redis,buobao/redis-3.0-annotated,thomasdarimont/redis,shshlzh/redis-3.0-annotated,gaoxianglong/redis,huangz1990/redis-3.0-annotated,zy416548283/redis-3.0-annotated,h0x91b/redis,janekmi/redis,gilala/bjredis,ton31337/redis,MasahikoSawada/redis,j0hnma/szredis,sunlianqiang/redis-3.0-annotated,holstvoogd/redis,shreesundara/redis,supasate/redis,nilyang/redis-tdd-annotation,antirez/redis,davidradunz/redis,gaoxianglong/redis,neomantra/redis,honestme/redis,fankeke/redis-3.0-annotated,soveran/redis,alenslan/redis,Sciumo/redis,Aliceljm1/redis,StevenTsai/redis,ofirluzon/redis,Hailei/redis,kmiku7/redis,colstrom/redis,MasahikoSawada/redis,duanx/redis,charsyam/redis,Hailei/redis,colstrom/redis,mgk/redis,pedigree/redis,timothyohare/3rdPartySrc-redis,wuyu201321060203/redis-3.0-annotated,josiahcarlson/redis,dreamquster/redis,rrsean/redis-3.0-annotated,mattsta/redis,louisliangjun/redis,ton31337/redis,nuxeh/redis,j0hnma/hszredis,honestme/redis,mverrilli/redis,mengzhejin/RedisStudy,mverrilli/redis,magastzheng/redis-3.0-annotated,linfangrong/redis,yuhc/redis-benchmark-enhanced,nnog/redis,harrisonfeng/redis,onlymellb/redis-3.0-annotated,zhiliaoniu/redis,mengyou0304/redis,pcarrier/redis,seppo0010/rlite-server,cloudrain21/redis,duanx/redis,tanghaodong25/redis,jackyan/redis,holstvoogd/redis,jacklee0810/redis-3.0-annotated,wenxueliu/redis_comment,jingjidejuren/redis,blackmady/redis,gilala/hbjredis,ctripcorp/redis,zy416548283/redis-3.0-annotated,Aaron1992/redis,tzq668766/redis-3.0-annotated,miaoyc1989/redis-3.0-annotated,narma/redis,twskipper/redis,MOON-CLJ/redis,hornen/redis,atreeyang/redis,ReadCode/redis-3.0-annotated,clamoriniere1A/redis,tellapart/redis,kmiku7/redis,saisai/redis,zhoudayang/redis,4396/redis,cloudrain21/redis,mengzhejin/RedisStudy,ketor/redis,rogerlz/redis,darksideofthemoo/redis-histogram,idning/redis,Sciumo/redis,spearhead-ea/redis,hedisdb/hedis,ksarch-saas/redis,ramonsnir/redis,ncopa/redis,rouzier/redis,mumingv/redis,nuxeh/redis,rrsean/redis-3.0-annotated,rogerchina/redis,cusspvz/redis,darksideofthemoo/redis-histogram,seppo0010/redis,jbochi/redis,fengshao0907/redis,huangz1990/redis-3.0-annotated,oranagra/redis,AALEKH/redis,himoca/redis,jxwr/redis,arijitvt/redis,gongice/redis-3.0-annotated,francischan714/redis,msn217/redis-3.0-annotated,hedisdb/hedis,AplayER/redis,gilala/hbjredis,dongqifan2/redis-3.0-annotated,izhoujie/redis,itugs/redis,charsyam/redis,july2993/redis,programmecat/redis,taoguan/redis,4396/redis,qiyang0221/redis,oranagra/redis,elkingtonmcb/redis,xuzhezhaozhao/redis_reading,JoeWoo/redis,Aaron1992/redis,mingyaaaa/redis,sunlianqiang/redis-3.0-annotated,HouKangkang/redis-3.0-annotated,Aliceljm1/redis,shining-yang/redis,csuhawk/redis,wprice/redis,rogerchina/redis,hawkchch/redis,fengshao0907/redis,j0hnma/szredis,roth1002/redis,JoeWoo/redis,atreeyang/redis,abhiklodh/redis,haima-zju/redis-3.0-annotated,shining-yang/redis,190235047/redis,zhcy/redis,xuguruogu/redis,j0hnma/szredis,mumingv/redis,blackmady/redis,zguangyu/redis,wprice/redis,atreeyang/redis,csuhawk/redis,pcarrier/redis,YuanZhewei/redis,zczhuohuo/redis,GitHubMota/redis,zhoudayang/redis,yossigo/redis,zguangyu/redis,YuraLukashik/redis,wuyu201321060203/redis-3.0-annotated,cloudrain21/redis,netroby/redis,a-pavlov/redis,sunheehnus/redis,hgl888/redis,izhoujie/redis,buobao/redis-3.0-annotated,soveran/redis,jbochi/parallel_redis,moonbingbing/redis-3.0-annotated,nilyang/redis-tdd-annotation,takeshineshiro/redis,pkdevbox/redis,gilala/redis,HeartSaVioR/redis,kaushik94/redis,cloudrain21/redis,himoca/redis,takeshineshiro/redis,wujf/redis,pcarrier/redis,spinlock/redis,ksarch-saas/redis,wenxueliu/redis_comment,MSOpenTech/redis,hedisdb/hedis,iandyh/redis,PradheepShrinivasan/redis,wbailey5/redis,holstvoogd/redis,wbailey5/redis,splitice/redis,jbochi/redis,nuxeh/redis,gilala/hbjredis,fankeke/redis-3.0-annotated,brg-liuwei/redis,0x55/redis-3.0-annotated,nnog/redis,kmiku7/redis,josiahcarlson/redis,janekmi/redis,SyntaxStacks/redis,wangyikai/redis,wangyikai/redis,abhiklodh/redis,AALEKH/redis,mattsta/redis,j0hnma/hszredis,ytjiang/redis,RepmujNetsik/redis,jbochi/parallel_redis,Wangyao14cyy/redis,zguangyu/redis,itamarhaber/redis,ton31337/redis,healerkx/redis,ttuna/msot-redis,HeartSaVioR/redis,dayuoba/redis,alenslan/redis,hgl888/redis,HunanTV/redis,spinlock/redis,linfangrong/redis,aim-for-better/redis,Soledad89/redis,drinkthere/redis-3.0-annotated,weizijun/redis,HouKangkang/redis-3.0-annotated,linfangrong/redis,netroby/redis,programmecat/redis,wbailey5/redis,0x55/redis-3.0-annotated,badboy/redis,hawkchch/redis,yossigo/redis,arijitvt/redis,Aliceljm1/redis-3.0-annotated,ytjiang/redis,zhoudayang/redis,alenslan/redis,drinkthere/redis-3.0-annotated,PradheepShrinivasan/redis,valdsJohn/redis,zhaobo1023/redis-3.0-annotated,mcanthony/redis,maodeyi/redis_lua,unasm/redis-3.0-annotated,modulexcite/redis,shreesundara/redis,aim-for-better/redis,GrimDerp/redis,soloestoy/redis,gongice/redis-3.0-annotated,SummonY/redis,kaushik94/redis,iandyh/redis,ituncle/redis,NBSW/redis,MasahikoSawada/redis,wenxueliu/redis_comment,narma/redis,xujunhai1991/redis,neomantra/redis,gilala/hredis,holstvoogd/redis,taoguan/redis,miaoyc1989/redis-3.0-annotated,jackyan/redis,gilala/hredis,Markgorden/redis,YongMan/redis,mcanthony/redis,wangyikai/redis,louisliangjun/redis,darksideofthemoo/redis-histogram,ouyangkongtong/redis,GitHubMota/redis,takeshineshiro/redis,Aaron1992/redis,weizijun/redis,Soledad89/redis,slfs007/mk-redis,riyan8250/redis,rouzier/redis,davidradunz/redis,whille/redis-3.0-annotated,pmem/redis,gilala/redis,PKRoma/redis,badboy/redis,idning/redis,Hailei/redis,antirez/redis,WorkingOfTimtohyZhang/redis-3.0-annotated,ttuna/msot-redis,NBSW/redis,jasonkying/redis,gaoxianglong/redis,rogerlz/redis,universsky/redis,gilala/hbjredis,gechong/redis-3.0-annotated,ouyangkongtong/redis,YuraLukashik/redis,adamweixuan/redis-3.0-annotated,valdsJohn/redis,xlzhan/redis,yossigo/redis,ramonsnir/redis,flashbuckets/redis,RepmujNetsik/redis,rogerchina/redis,MSOpenTech/redis,wujf/redis,arijitvt/redis,YongMan/redis,xlzhan/redis,wuyu201321060203/redis-3.0-annotated,mverrilli/redis,moonbingbing/redis-3.0-annotated,Wangyao14cyy/redis,moonbingbing/redis-3.0-annotated,jasonkying/redis,zhcy/redis,jasonkying/redis,yossigo/redis,zczhuohuo/redis,programmecat/redis,mumingv/redis-3.0-annotated,hedisdb/hedis,mgk/redis,tzq668766/redis-3.0-annotated,jingjidejuren/redis,PKRoma/redis,wenxueliu/redis_comment,nuxeh/redis,zguangyu/redis,cnbin/redis,NBSW/redis,citusdata/redis,mumingv/redis,alenslan/redis,atreeyang/redis,brg-liuwei/redis,yybirdcf/learn-redis,july2993/redis,hornen/redis,MSOpenTech/redis,190235047/redis,gilala/hredis,Markgorden/redis,splitice/redis,flashbuckets/redis,brg-liuwei/redis,antirez/redis,louisliangjun/redis,seandsky/redis,duanx/redis,dreamquster/redis,mumingv/redis-3.0-annotated,gongice/redis-3.0-annotated,fengshao0907/redis,ttuna/msot-redis,dongqifan2/redis-3.0-annotated,Sciumo/redis,miaoyc1989/redis-3.0-annotated,YongMan/redis,flashbuckets/redis,harrisonfeng/redis,haima-zju/redis-3.0-annotated,clamoriniere1A/redis,badboy/redis,GitHubMota/redis,jackyan/redis,SummonY/redis,takeshineshiro/redis,josiahcarlson/redis,z-fork/redis,pkdevbox/redis,gechong/redis-3.0-annotated,citusdata/redis,clamoriniere1A/redis,cusspvz/redis,huyuezheng/redis,mengzhejin/RedisStudy,RepmujNetsik/redis,MOON-CLJ/redis,jbochi/parallel_redis,z-fork/redis,neomantra/redis,onlymellb/redis-3.0-annotated,zhaobo1023/redis-3.0-annotated,CodeJuan/redis,ouyangkongtong/redis,zhiliaoniu/redis,tellapart/redis,rouzier/redis,YuanZhewei/redis,PradheepShrinivasan/redis,xuzhezhaozhao/redis_reading,izhoujie/redis,jingjidejuren/redis,unasm/redis-3.0-annotated,janekmi/redis,universsky/redis,fengshao0907/redis-3.0-annotated,riyan8250/redis,HouKangkang/redis-3.0-annotated,ncopa/redis,gilala/bjredis,ksarch-saas/redis,CodeJuan/redis,itugs/redis,universsky/redis,vincent-vivian-liu/redis,idning/redis,maodeyi/redis_lua,simplestbest/redis,tjschuck/redis,miaoyc1989/redis-3.0-annotated,SyntaxStacks/redis,ipmobiletech/redis,ctripcorp/redis,itugs/redis,190235047/redis,ton31337/redis,roth1002/redis,huyuezheng/redis,charsyam/redis,OmarQunsul/graph-redis,gilala/redis,taoguan/redis,onlymellb/redis-3.0-annotated,hawkchch/redis,Markgorden/redis,ttuna/msot-redis,maodeyi/redis_lua,elkingtonmcb/redis,j0hnma/szredis,xlzhan/redis,yuzhangjob/redis-3.0-annotated-unstable,ipmobiletech/redis,csuhawk/redis,aim-for-better/redis,itamarhaber/redis,tanghaodong25/redis,twskipper/redis,ofirluzon/redis,CodeJuan/redis,thomasdarimont/redis,AplayER/redis,saisai/redis,GrimDerp/redis,soloestoy/redis,4396/redis,honestme/redis,yossigo/redis,devaos/redis,PKRoma/redis,splitice/redis,healerkx/redis,jasonkying/redis,PradheepShrinivasan/redis,StevenTsai/redis,Aliceljm1/redis-3.0-annotated,pedigree/redis,iandyh/redis,OmarQunsul/graph-redis,mcanthony/redis,saisai/redis,slfs007/mk-redis,dongqifan2/redis-3.0-annotated,ouyangkongtong/redis,sunheehnus/redis,HeartSaVioR/redis,soveran/redis,msn217/redis-3.0-annotated,tjschuck/redis,zczhuohuo/redis,dreamquster/redis,ituncle/redis,abhiklodh/redis,universsky/redis,ErikDubbelboer/redis,Aliceljm1/redis,WorkingOfTimtohyZhang/redis-3.0-annotated,abhiklodh/redis,francischan714/redis,drinkthere/redis-3.0-annotated,shshlzh/redis-3.0-annotated,Soledad89/redis,flashbuckets/redis,ytjiang/redis,YuraLukashik/redis,narma/redis,fengshao0907/redis-3.0-annotated,CodeJuan/redis,GrimDerp/redis,seppo0010/rlite-server,Aaron1992/redis,neomantra/redis,AALEKH/redis,tellapart/redis,ketor/redis,mverrilli/redis,healerkx/redis,yuzhangjob/redis-3.0-annotated-unstable,valdsJohn/redis,Hailei/redis,huangz1990/redis-3.0-annotated,oranagra/redis,ErikDubbelboer/redis,jxwr/redis,spearhead-ea/redis,wprice/redis,ipmobiletech/redis,huyuezheng/redis,iandyh/redis,csuhawk/redis,mumingv/redis,tellapart/redis,magastzheng/redis-3.0-annotated,zczhuohuo/redis,mengzhejin/RedisStudy,yybirdcf/learn-redis,riyan8250/redis,whille/redis-3.0-annotated,hornen/redis,sunlianqiang/redis-3.0-annotated,simplestbest/redis,antirez/redis,dayuoba/redis,thomasdarimont/redis,saisai/redis,mengyou0304/redis,0x55/redis-3.0-annotated,pmem/redis,190235047/redis,yybirdcf/learn-redis,HunanTV/redis,aim-for-better/redis,whille/redis-3.0-annotated,zhcy/redis,seppo0010/redis,tjschuck/redis,tjschuck/redis,kaushik94/redis,JoeWoo/redis,mattsta/redis,simplestbest/redis,soloestoy/redis,taoguan/redis,modulexcite/redis