Fix script cache bug in the scripting engine.
Fix script cache bug in the scripting engine.

This commit fixes a serious Lua scripting replication issue, described
by Github issue #1549. The root cause of the problem is that scripts
were put inside the script cache, assuming that slaves and AOF already
contained it, even if the scripts sometimes produced no changes in the
data set, and were not actaully propagated to AOF/slaves.

Example:

    eval "if tonumber(KEYS[1]) > 0 then redis.call('incr', 'x') end" 1 0

Then:

    evalsha <sha1 step 1 script> 1 0

At this step sha1 of the script is added to the replication script cache
(the script is marked as known to the slaves) and EVALSHA command is
transformed to EVAL. However it is not dirty (there is no changes to db),
so it is not propagated to the slaves. Then the script is called again:

    evalsha <sha1 step 1 script> 1 1

At this step master checks that the script already exists in the
replication script cache and doesn't transform it to EVAL command. It is
dirty and propagated to the slaves, but they fail to evaluate the script
as they don't have it in the script cache.

The fix is trivial and just uses the new API to force the propagation of
the executed command regardless of the dirty state of the data set.

Thank you to @minus-infinity on Github for finding the issue,
understanding the root cause, and fixing it.

csuhawk/redis,ituncle/redis,zguangyu/redis,Sciumo/redis,yuhc/redis-benchmark-enhanced,yossigo/redis,hedisdb/hedis,modulexcite/redis,shining-yang/redis,GrimDerp/redis,pkdevbox/redis,yossigo/redis,janekmi/redis,colstrom/redis,HeartSaVioR/redis,cnbin/redis,YuanZhewei/redis,PradheepShrinivasan/redis,atreeyang/redis,guker/redis,PKRoma/redis,gilala/hbjredis,izhoujie/redis,mumingv/redis,kensou97/redis,antirez/redis,mcanthony/redis,hedisdb/hedis,allengaller/redis,YongMan/redis,brg-liuwei/redis,gilala/redis,thomasdarimont/redis,tellapart/redis,pedigree/redis,pkdevbox/redis,universsky/redis,huyuezheng/redis,j0hnma/hszredis,YongMan/redis,tjschuck/redis,Aaron1992/redis,4396/redis,CodeJuan/redis,oranagra/redis,soveran/redis,hawkchch/redis,jbochi/redis,jbochi/redis,ErikDubbelboer/redis,iandyh/redis,tjschuck/redis,gilala/hbjredis,xujunhai1991/redis,YongMan/redis,Soledad89/redis,xuguruogu/redis,gilala/redis,wujf/redis,sunheehnus/redis,zguangyu/redis,hawkchch/redis,dreamquster/redis,j0hnma/szredis,atreeyang/redis,mengyou0304/redis,kensou97/redis,h0x91b/redis,a-pavlov/redis,NBSW/redis,LongXQ/redis,blackmady/redis,csuhawk/redis,ctripcorp/redis,dreamquster/redis,citusdata/redis,honestme/redis,clamoriniere1A/redis,sunheehnus/redis,dayuoba/redis,simplestbest/redis,190235047/redis,LongXQ/redis,vincent-vivian-liu/redis,elkingtonmcb/redis,davidradunz/redis,universsky/redis,CodeJuan/redis,netroby/redis,seppo0010/redis,saisai/redis,pcarrier/redis,nnog/redis,ipmobiletech/redis,nnog/redis,j0hnma/hszredis,guker/redis,rogerchina/redis,soveran/redis,MasahikoSawada/redis,h0x91b/redis,wangyikai/redis,ofirluzon/redis,xlzhan/redis,mumingv/redis,mattsta/redis,mgk/redis,csuhawk/redis,july2993/redis,ctripcorp/redis,antirez/redis,YuraLukashik/redis,jackyan/redis,flashbuckets/redis,elkingtonmcb/redis,taoguan/redis,elkingtonmcb/redis,mumingv/redis,abhiklodh/redis,AALEKH/redis,twskipper/redis,Sciumo/redis,netroby/redis,supasate/redis,GrimDerp/redis,AALEKH/redis,antirez/redis,taoguan/redis,Aliceljm1/redis,charsyam/redis,hgl888/redis,dreamquster/redis,rogerlz/redis,ytjiang/redis,timothyohare/3rdPartySrc-redis,narma/redis,wujf/redis,gaoxianglong/redis,devaos/redis,Markgorden/redis,nuxeh/redis,takeshineshiro/redis,neomantra/redis,modulexcite/redis,arijitvt/redis,gilala/hredis,wprice/redis,qiyang0221/redis,duanx/redis,itamarhaber/redis,shining-yang/redis,nuxeh/redis,pcarrier/redis,aim-for-better/redis,badboy/redis,duanx/redis,rouzier/redis,hornen/redis,ErikDubbelboer/redis,clamoriniere1A/redis,wprice/redis,dayuoba/redis,ipmobiletech/redis,xuguruogu/redis,PradheepShrinivasan/redis,gilala/redis,jasonkying/redis,holstvoogd/redis,ton31337/redis,gilala/hbjredis,neomantra/redis,guker/redis,jackyan/redis,narma/redis,ipmobiletech/redis,valdsJohn/redis,harrisonfeng/redis,mingyaaaa/redis,iandyh/redis,seppo0010/redis,vincent-vivian-liu/redis,holstvoogd/redis,xujunhai1991/redis,jackyan/redis,mengzhejin/RedisStudy,harrisonfeng/redis,netroby/redis,alenslan/redis,mgk/redis,190235047/redis,soloestoy/redis,davidradunz/redis,cloudrain21/redis,seppo0010/redis,huyuezheng/redis,nnog/redis,hornen/redis,ytjiang/redis,zhiliaoniu/redis,holstvoogd/redis,soloestoy/redis,kensou97/redis,neomantra/redis,arijitvt/redis,j0hnma/hszredis,Markgorden/redis,nuxeh/redis,h0x91b/redis,nuxeh/redis,neomantra/redis,h0x91b/redis,mengzhejin/RedisStudy,thomasdarimont/redis,jbochi/parallel_redis,programmecat/redis,OmarQunsul/graph-redis,CodeJuan/redis,tellapart/redis,NBSW/redis,yybirdcf/learn-redis,Aliceljm1/redis,ipmobiletech/redis,wbailey5/redis,flashbuckets/redis,mattsta/redis,jasonkying/redis,ouyangkongtong/redis,simplestbest/redis,mverrilli/redis,qiyang0221/redis,jingjidejuren/redis,shreesundara/redis,xlzhan/redis,twskipper/redis,aim-for-better/redis,a-pavlov/redis,linfangrong/redis,atreeyang/redis,zhcy/redis,arijitvt/redis,wbailey5/redis,zguangyu/redis,ouyangkongtong/redis,twskipper/redis,wbailey5/redis,PKRoma/redis,shreesundara/redis,mengyou0304/redis,charsyam/redis,JoeWoo/redis,honestme/redis,ofirluzon/redis,pcarrier/redis,Aliceljm1/redis,fengshao0907/redis,OmarQunsul/graph-redis,PKRoma/redis,Aliceljm1/redis,mverrilli/redis,kaushik94/redis,seandsky/redis,colstrom/redis,kaushik94/redis,qiyang0221/redis,holstvoogd/redis,kmiku7/redis,JoeWoo/redis,gilala/hbjredis,wujf/redis,NBSW/redis,roth1002/redis,izhoujie/redis,alenslan/redis,abhiklodh/redis,PradheepShrinivasan/redis,modulexcite/redis,narma/redis,itugs/redis,rogerchina/redis,kaushik94/redis,sunheehnus/redis,seandsky/redis,AALEKH/redis,itugs/redis,oranagra/redis,dayuoba/redis,wprice/redis,spinlock/redis,PKRoma/redis,gilala/bjredis,ofirluzon/redis,GitHubMota/redis,linfangrong/redis,fengshao0907/redis,brg-liuwei/redis,rouzier/redis,gilala/redis,zczhuohuo/redis,itugs/redis,mgk/redis,weizijun/redis,blackmady/redis,ituncle/redis,takeshineshiro/redis,timothyohare/3rdPartySrc-redis,harrisonfeng/redis,oranagra/redis,healerkx/redis,zhiliaoniu/redis,seppo0010/rlite-server,july2993/redis,alenslan/redis,josiahcarlson/redis,hgl888/redis,ton31337/redis,universsky/redis,dreamquster/redis,colstrom/redis,huyuezheng/redis,RepmujNetsik/redis,xujunhai1991/redis,MOON-CLJ/redis,clamoriniere1A/redis,spinlock/redis,rogerchina/redis,ctripcorp/redis,twskipper/redis,zhiliaoniu/redis,YuraLukashik/redis,cloudrain21/redis,francischan714/redis,jbochi/redis,HeartSaVioR/redis,badboy/redis,spinlock/redis,hedisdb/hedis,shining-yang/redis,wbailey5/redis,Soledad89/redis,SyntaxStacks/redis,HeartSaVioR/redis,linfangrong/redis,kmiku7/redis,a-pavlov/redis,izhoujie/redis,idning/redis,brg-liuwei/redis,charsyam/redis,csuhawk/redis,4396/redis,tanghaodong25/redis,mgk/redis,neomantra/redis,mumingv/redis,weizijun/redis,jingjidejuren/redis,ton31337/redis,4396/redis,z-fork/redis,devaos/redis,nnog/redis,programmecat/redis,mengzhejin/RedisStudy,cloudrain21/redis,cnbin/redis,mengyou0304/redis,hawkchch/redis,shreesundara/redis,YongMan/redis,GrimDerp/redis,supasate/redis,harrisonfeng/redis,cusspvz/redis,ncopa/redis,qiyang0221/redis,Markgorden/redis,Wangyao14cyy/redis,SummonY/redis,jbochi/parallel_redis,PKRoma/redis,JoeWoo/redis,saisai/redis,modulexcite/redis,weizijun/redis,soloestoy/redis,xlzhan/redis,ctripcorp/redis,MasahikoSawada/redis,z-fork/redis,july2993/redis,cnbin/redis,pedigree/redis,wenxueliu/redis_comment,supasate/redis,roth1002/redis,itamarhaber/redis,AplayER/redis,StevenTsai/redis,mengzhejin/RedisStudy,duanx/redis,SummonY/redis,fengshao0907/redis,mcanthony/redis,ofirluzon/redis,allengaller/redis,pmem/redis,davidradunz/redis,yossigo/redis,alenslan/redis,davidradunz/redis,j0hnma/hszredis,jbochi/parallel_redis,xuguruogu/redis,yossigo/redis,ouyangkongtong/redis,citusdata/redis,blackmady/redis,mcanthony/redis,izhoujie/redis,zguangyu/redis,z-fork/redis,kaushik94/redis,aim-for-better/redis,abhiklodh/redis,gaoxianglong/redis,badboy/redis,seandsky/redis,citusdata/redis,4396/redis,ituncle/redis,saisai/redis,cusspvz/redis,kmiku7/redis,mverrilli/redis,pkdevbox/redis,roth1002/redis,jackyan/redis,GitHubMota/redis,idning/redis,LongXQ/redis,ofirluzon/redis,josiahcarlson/redis,RepmujNetsik/redis,programmecat/redis,mverrilli/redis,StevenTsai/redis,soloestoy/redis,honestme/redis,ton31337/redis,jasonkying/redis,OmarQunsul/graph-redis,seppo0010/rlite-server,seppo0010/redis,valdsJohn/redis,ncopa/redis,hgl888/redis,valdsJohn/redis,ketor/redis,PradheepShrinivasan/redis,AplayER/redis,mcanthony/redis,universsky/redis,OmarQunsul/graph-redis,kmiku7/redis,healerkx/redis,itamarhaber/redis,saisai/redis,idning/redis,colstrom/redis,timothyohare/3rdPartySrc-redis,abhiklodh/redis,roth1002/redis,shining-yang/redis,ErikDubbelboer/redis,valdsJohn/redis,zczhuohuo/redis,fengshao0907/redis,Soledad89/redis,atreeyang/redis,gilala/bjredis,sunheehnus/redis,mingyaaaa/redis,rogerlz/redis,flashbuckets/redis,hawkchch/redis,yuhc/redis-benchmark-enhanced,GitHubMota/redis,MOON-CLJ/redis,gilala/hredis,healerkx/redis,Aaron1992/redis,AplayER/redis,gilala/hredis,simplestbest/redis,netroby/redis,gaoxianglong/redis,mingyaaaa/redis,SyntaxStacks/redis,Wangyao14cyy/redis,supasate/redis,gilala/bjredis,charsyam/redis,taoguan/redis,vincent-vivian-liu/redis,z-fork/redis,pmem/redis,charsyam/redis,ketor/redis,guker/redis,rogerlz/redis,oranagra/redis,devaos/redis,jasonkying/redis,arijitvt/redis,Wangyao14cyy/redis,GrimDerp/redis,jingjidejuren/redis,Aaron1992/redis,StevenTsai/redis,ncopa/redis,hornen/redis,thomasdarimont/redis,pcarrier/redis,josiahcarlson/redis,xlzhan/redis,linfangrong/redis,AplayER/redis,wujf/redis,iandyh/redis,seppo0010/rlite-server,wangyikai/redis,francischan714/redis,wenxueliu/redis_comment,190235047/redis,MOON-CLJ/redis,rouzier/redis,mingyaaaa/redis,ytjiang/redis,itugs/redis,weizijun/redis,takeshineshiro/redis,hedisdb/hedis,healerkx/redis,YuraLukashik/redis,zhiliaoniu/redis,yuhc/redis-benchmark-enhanced,riyan8250/redis,francischan714/redis,yybirdcf/learn-redis,cnbin/redis,clamoriniere1A/redis,Aaron1992/redis,cusspvz/redis,iandyh/redis,tjschuck/redis,pkdevbox/redis,SummonY/redis,CodeJuan/redis,j0hnma/szredis,ketor/redis,j0hnma/szredis,SyntaxStacks/redis,gaoxianglong/redis,thomasdarimont/redis,yossigo/redis,citusdata/redis,janekmi/redis,pedigree/redis,ErikDubbelboer/redis,hgl888/redis,tellapart/redis,rouzier/redis,idning/redis,wprice/redis,YuanZhewei/redis,pmem/redis,kensou97/redis,francischan714/redis,Markgorden/redis,elkingtonmcb/redis,xuguruogu/redis,aim-for-better/redis,gilala/hredis,AALEKH/redis,riyan8250/redis,zczhuohuo/redis,jingjidejuren/redis,MasahikoSawada/redis,takeshineshiro/redis,wangyikai/redis,honestme/redis,shreesundara/redis,yuhc/redis-benchmark-enhanced,HeartSaVioR/redis,taoguan/redis,timothyohare/3rdPartySrc-redis,tanghaodong25/redis,SummonY/redis,a-pavlov/redis,simplestbest/redis,ouyangkongtong/redis,vincent-vivian-liu/redis,Sciumo/redis,ytjiang/redis,LongXQ/redis,badboy/redis,NBSW/redis,zhcy/redis,spinlock/redis,soloestoy/redis,GitHubMota/redis,rogerchina/redis,janekmi/redis,allengaller/redis,duanx/redis,xujunhai1991/redis,ituncle/redis,wenxueliu/redis_comment,allengaller/redis,dayuoba/redis,cusspvz/redis,hornen/redis,seandsky/redis,Sciumo/redis,soveran/redis,wenxueliu/redis_comment,wangyikai/redis,huyuezheng/redis,RepmujNetsik/redis,rogerlz/redis,devaos/redis,mattsta/redis,YuanZhewei/redis,YuanZhewei/redis,zczhuohuo/redis,blackmady/redis,YuraLukashik/redis,StevenTsai/redis,RepmujNetsik/redis,janekmi/redis,tjschuck/redis,flashbuckets/redis,seppo0010/rlite-server,tellapart/redis,yybirdcf/learn-redis,programmecat/redis,antirez/redis,zhcy/redis,zhcy/redis,Soledad89/redis,SyntaxStacks/redis,riyan8250/redis,JoeWoo/redis,j0hnma/szredis,yybirdcf/learn-redis,mengyou0304/redis,josiahcarlson/redis,tanghaodong25/redis,pmem/redis,pedigree/redis,gilala/bjredis,itamarhaber/redis,oranagra/redis,cloudrain21/redis,ncopa/redis,july2993/redis,Wangyao14cyy/redis,soveran/redis,tanghaodong25/redis,brg-liuwei/redis,riyan8250/redis,190235047/redis,MasahikoSawada/redis