Mark the log_number file number used
Mark the log_number file number used

Summary:
VersionSet::next_file_number_ is always assumed to be strictly greater than VersionSet::log_number_. In our new recovery code, we artificially set log_number_  to be (log_number + 1), so that once we flush, we don't recover from the same log file again (this is important because of merge operator non-idempotence)

When we set VersionSet::log_number_ to (log_number + 1), we also have to mark that file number used, such that next_file_number_ is increased to a legal level. Otherwise, VersionSet might assert.

This has not be a problem so far because here's what happens:
1. assume next_file_number is 5, we're recovering log_number 10
2. in DBImpl::Recover() we call MarkFileNumberUsed with 10. This will set VersionSet::next_file_number_ to 11.
3. If there are some updates, we will call WriteTable0ForRecovery(), which will use file number 11 as a new table file and advance VersionSet::next_file_number_ to 12.
4. When we LogAndApply() with log_number 11, assertion is true: assert(11 <= 12);

However, this was a lucky occurrence. Even though this diff doesn't cause a bug, I think the issue is important to fix.

Test Plan: In column families I have different recovery logic and this code path asserted. When adding MarkFileNumberUsed(log_number + 1) assert is gone.

Reviewers: dhruba, kailiu

Reviewed By: kailiu

CC: leveldb

Differential Revision: https://reviews.facebook.net/D15783

Vaisman/rocksdb,wskplho/rocksdb,norton/rocksdb,IMCG/RcoksDB,tschottdorf/rocksdb,sorphi/rocksdb,vashstorm/rocksdb,fengshao0907/rocksdb,IMCG/RcoksDB,anagav/rocksdb,vmx/rocksdb,jalexanderqed/rocksdb,facebook/rocksdb,msb-at-yahoo/rocksdb,facebook/rocksdb,mbarbon/rocksdb,jalexanderqed/rocksdb,rDSN-Projects/rocksdb.replicated,norton/rocksdb,norton/rocksdb,Andymic/rocksdb,anagav/rocksdb,makelivedotnet/rocksdb,alihalabyah/rocksdb,wenduo/rocksdb,rDSN-Projects/rocksdb.replicated,RyanTech/rocksdb,ylong/rocksdb,mbarbon/rocksdb,IMCG/RcoksDB,Vaisman/rocksdb,wat-ze-hex/rocksdb,fengshao0907/rocksdb,kaschaeffer/rocksdb,makelivedotnet/rocksdb,luckywhu/rocksdb,Applied-Duality/rocksdb,dkorolev/rocksdb,JohnPJenkins/rocksdb,temicai/rocksdb,vmx/rocksdb,wskplho/rocksdb,rDSN-Projects/rocksdb.replicated,siddhartharay007/rocksdb,facebook/rocksdb,vmx/rocksdb,alihalabyah/rocksdb,mbarbon/rocksdb,tsheasha/rocksdb,Andymic/rocksdb,tsheasha/rocksdb,ylong/rocksdb,SunguckLee/RocksDB,kaschaeffer/rocksdb,flabby/rocksdb,caijieming-baidu/rocksdb,flabby/rocksdb,SunguckLee/RocksDB,skunkwerks/rocksdb,OverlordQ/rocksdb,RyanTech/rocksdb,zhangpng/rocksdb,lgscofield/rocksdb,OverlordQ/rocksdb,amyvmiwei/rocksdb,tizzybec/rocksdb,virtdb/rocksdb,IMCG/RcoksDB,kaschaeffer/rocksdb,rDSN-Projects/rocksdb.replicated,kaschaeffer/rocksdb,SunguckLee/RocksDB,JoeWoo/rocksdb,sorphi/rocksdb,temicai/rocksdb,OverlordQ/rocksdb,skunkwerks/rocksdb,Andymic/rocksdb,msb-at-yahoo/rocksdb,skunkwerks/rocksdb,rDSN-Projects/rocksdb.replicated,makelivedotnet/rocksdb,anagav/rocksdb,Andymic/rocksdb,wskplho/rocksdb,SunguckLee/RocksDB,wlqGit/rocksdb,amyvmiwei/rocksdb,vashstorm/rocksdb,virtdb/rocksdb,mbarbon/rocksdb,tizzybec/rocksdb,zhangpng/rocksdb,temicai/rocksdb,wat-ze-hex/rocksdb,Andymic/rocksdb,wenduo/rocksdb,siddhartharay007/rocksdb,vmx/rocksdb,vmx/rocksdb,flabby/rocksdb,vashstorm/rocksdb,msb-at-yahoo/rocksdb,flabby/rocksdb,fengshao0907/rocksdb,JoeWoo/rocksdb,SunguckLee/RocksDB,jalexanderqed/rocksdb,fengshao0907/rocksdb,luckywhu/rocksdb,JoeWoo/rocksdb,wenduo/rocksdb,facebook/rocksdb,lgscofield/rocksdb,norton/rocksdb,IMCG/RcoksDB,amyvmiwei/rocksdb,bbiao/rocksdb,wskplho/rocksdb,virtdb/rocksdb,SunguckLee/RocksDB,fengshao0907/rocksdb,amyvmiwei/rocksdb,JackLian/rocksdb,JohnPJenkins/rocksdb,zhangpng/rocksdb,vashstorm/rocksdb,NickCis/rocksdb,dkorolev/rocksdb,hobinyoon/rocksdb,ryneli/rocksdb,amyvmiwei/rocksdb,sorphi/rocksdb,Applied-Duality/rocksdb,JoeWoo/rocksdb,NickCis/rocksdb,kaschaeffer/rocksdb,bbiao/rocksdb,Vaisman/rocksdb,dkorolev/rocksdb,ryneli/rocksdb,vmx/rocksdb,dkorolev/rocksdb,rDSN-Projects/rocksdb.replicated,wenduo/rocksdb,JohnPJenkins/rocksdb,biddyweb/rocksdb,JohnPJenkins/rocksdb,tschottdorf/rocksdb,ylong/rocksdb,JackLian/rocksdb,ryneli/rocksdb,tsheasha/rocksdb,wskplho/rocksdb,msb-at-yahoo/rocksdb,wat-ze-hex/rocksdb,siddhartharay007/rocksdb,biddyweb/rocksdb,sorphi/rocksdb,mbarbon/rocksdb,wlqGit/rocksdb,caijieming-baidu/rocksdb,lgscofield/rocksdb,facebook/rocksdb,bbiao/rocksdb,amyvmiwei/rocksdb,bbiao/rocksdb,skunkwerks/rocksdb,JoeWoo/rocksdb,alihalabyah/rocksdb,wat-ze-hex/rocksdb,anagav/rocksdb,jalexanderqed/rocksdb,tschottdorf/rocksdb,wenduo/rocksdb,biddyweb/rocksdb,hobinyoon/rocksdb,Andymic/rocksdb,Applied-Duality/rocksdb,zhangpng/rocksdb,ylong/rocksdb,JohnPJenkins/rocksdb,hobinyoon/rocksdb,Vaisman/rocksdb,geraldoandradee/rocksdb,wlqGit/rocksdb,mbarbon/rocksdb,Applied-Duality/rocksdb,biddyweb/rocksdb,NickCis/rocksdb,tizzybec/rocksdb,virtdb/rocksdb,hobinyoon/rocksdb,ryneli/rocksdb,bbiao/rocksdb,alihalabyah/rocksdb,tsheasha/rocksdb,vashstorm/rocksdb,OverlordQ/rocksdb,wlqGit/rocksdb,RyanTech/rocksdb,caijieming-baidu/rocksdb,jalexanderqed/rocksdb,wenduo/rocksdb,Vaisman/rocksdb,wat-ze-hex/rocksdb,tsheasha/rocksdb,luckywhu/rocksdb,flabby/rocksdb,vmx/rocksdb,norton/rocksdb,NickCis/rocksdb,virtdb/rocksdb,facebook/rocksdb,skunkwerks/rocksdb,caijieming-baidu/rocksdb,SunguckLee/RocksDB,hobinyoon/rocksdb,tschottdorf/rocksdb,wenduo/rocksdb,makelivedotnet/rocksdb,IMCG/RcoksDB,JackLian/rocksdb,biddyweb/rocksdb,lgscofield/rocksdb,flabby/rocksdb,kaschaeffer/rocksdb,ylong/rocksdb,wat-ze-hex/rocksdb,tizzybec/rocksdb,ylong/rocksdb,siddhartharay007/rocksdb,bbiao/rocksdb,vashstorm/rocksdb,skunkwerks/rocksdb,hobinyoon/rocksdb,wlqGit/rocksdb,flabby/rocksdb,geraldoandradee/rocksdb,fengshao0907/rocksdb,ryneli/rocksdb,OverlordQ/rocksdb,vashstorm/rocksdb,virtdb/rocksdb,msb-at-yahoo/rocksdb,Vaisman/rocksdb,jalexanderqed/rocksdb,geraldoandradee/rocksdb,ylong/rocksdb,ryneli/rocksdb,alihalabyah/rocksdb,JackLian/rocksdb,JohnPJenkins/rocksdb,biddyweb/rocksdb,tsheasha/rocksdb,tizzybec/rocksdb,luckywhu/rocksdb,skunkwerks/rocksdb,tsheasha/rocksdb,biddyweb/rocksdb,sorphi/rocksdb,zhangpng/rocksdb,dkorolev/rocksdb,tizzybec/rocksdb,kaschaeffer/rocksdb,geraldoandradee/rocksdb,NickCis/rocksdb,bbiao/rocksdb,Andymic/rocksdb,alihalabyah/rocksdb,Applied-Duality/rocksdb,bbiao/rocksdb,hobinyoon/rocksdb,NickCis/rocksdb,mbarbon/rocksdb,tschottdorf/rocksdb,geraldoandradee/rocksdb,wlqGit/rocksdb,wskplho/rocksdb,siddhartharay007/rocksdb,RyanTech/rocksdb,NickCis/rocksdb,lgscofield/rocksdb,tizzybec/rocksdb,JackLian/rocksdb,OverlordQ/rocksdb,fengshao0907/rocksdb,zhangpng/rocksdb,jalexanderqed/rocksdb,Andymic/rocksdb,caijieming-baidu/rocksdb,norton/rocksdb,msb-at-yahoo/rocksdb,alihalabyah/rocksdb,dkorolev/rocksdb,anagav/rocksdb,sorphi/rocksdb,IMCG/RcoksDB,anagav/rocksdb,facebook/rocksdb,temicai/rocksdb,geraldoandradee/rocksdb,Vaisman/rocksdb,hobinyoon/rocksdb,temicai/rocksdb,ryneli/rocksdb,wenduo/rocksdb,virtdb/rocksdb,makelivedotnet/rocksdb,wlqGit/rocksdb,Applied-Duality/rocksdb,vmx/rocksdb,luckywhu/rocksdb,OverlordQ/rocksdb,wat-ze-hex/rocksdb,SunguckLee/RocksDB,norton/rocksdb,JoeWoo/rocksdb,RyanTech/rocksdb,anagav/rocksdb,siddhartharay007/rocksdb,sorphi/rocksdb,makelivedotnet/rocksdb,makelivedotnet/rocksdb,siddhartharay007/rocksdb,rDSN-Projects/rocksdb.replicated,norton/rocksdb,JackLian/rocksdb,tschottdorf/rocksdb,luckywhu/rocksdb,tsheasha/rocksdb,JohnPJenkins/rocksdb,wskplho/rocksdb,lgscofield/rocksdb,wat-ze-hex/rocksdb,facebook/rocksdb,JoeWoo/rocksdb,RyanTech/rocksdb,geraldoandradee/rocksdb,luckywhu/rocksdb,Applied-Duality/rocksdb,lgscofield/rocksdb,zhangpng/rocksdb,JackLian/rocksdb,dkorolev/rocksdb,caijieming-baidu/rocksdb,temicai/rocksdb,temicai/rocksdb,caijieming-baidu/rocksdb,RyanTech/rocksdb,amyvmiwei/rocksdb