spotify / cassandra-reaper

Software to run automated repairs of cassandra
235 stars 60 forks source link

Arithmetic Exception, division by 0 #109

Closed djsly closed 6 years ago

djsly commented 9 years ago
  public static int getPossibleParallelRepairsCount(Map<List<String>, List<String>> ranges)
      throws ReaperException {
    if (ranges.size() == 0) {
      String msg = "Repairing 0-sized cluster.";
      LOG.error(msg);
      throw new ReaperException(msg);
    }
    return ranges.size() / ranges.values().iterator().next().size();
  }

my ranges contains no values (no endPoint), how would that be possible ? I'm not super familiar with Cassandra's internal.

{[2611504485045026489, 2615130133280966460]=[], [7274155616532593021, 7278291118132873602]=[], [3054106705702366443, 3055273262771481433]=[], [8609404532022392496, 8636088058183964814]=[], [-2623657254929043697, -2612593662847064200]=[], [-5221194959218228745, -5194047772672100208]=[], [2745819238607856147, 2770130583011817306]=[], [-7999645183218416099, -7996023586490762505]=[], [6508128789230567670, 6528741294189409016]=[], [5226309577100597733, 5244671631025045787]=[], [3959201707837294381, 3966256120497110936]=[], [-5644009797308341302, -5625436891321622136]=[], [3783559696387918540, 3802651562781519779]=[], [-8083608256777565735, -8075625381541615307]=[], [-4592600165800377201, -4591126960720786341]=[], [6963379035523023862, 6966105798152398875]=[], [-2873661126563962000, -2865006698360587614]=[], [-3020441752010504375, -3011810835899829272]=[], [-6700462238301430269, -6699675242730251345]=[], [5303188487510411273, 5315618109505838630]=[], [1730432212229141980, 1775046580520098842]=[], [-7837449111407677059, -7835533857396313744]=[], [3608126377440011913, 3631763644187782196]=[], [1707987676098870457, 1715278190568603790]=[], [1262100321431177247, 1282693436558994280]=[], [-4238320399166945720, -4231722489526295728]=[], [-3527036946169677816, -3517969055276438922]=[], [186748954390194875, 212371013041908784]=[], [-3054876837884326554, -3047569376577333773]=[], [-1603482665970338357, -1586132657391656566]=[], [6482788915242085216, 6491980926278450301]=[], [-109575287580986427, -95112322885815284]=[], [-7835533857396313744, -7813710847714650905]=[], [5515671905275458960, 5528493110189420233]=[], [-8332208069486211233, -8322828368529916204]=[], [870287520923088409, 906880799052678148]=[], [-5906296738643732553, -5898911102407369534]=[], [-1154549854382614947, -1152130983607815360]=[], [-853787615013518331, -853561760424292496]=[], [8740747575121493913, 8744383075276610422]=[], [8536024164660715472, 8581577728470934773]=[], [-6099801613660131827, -6094779650796445105]=[], [-4815445404098203546, -4760596029286127984]=[], [793625834421362534, 802063842358511807]=[], [-6978727080305525807, -6960767413033219609]=[], [2653949753285750519, 2716129961675479772]=[], [-115625167908946349, -109575287580986427]=[], [-942808367997680743, -939340085718116907]=[], [-1191905990458365409, -1186950452358740285]=[], [-4548275129798136721, -4521880798213419919]=[], [2652653296481014382, 2653949753285750519]=[], [4820701567469045791, 4831307925540474322]=[], [-6882225436192255342, -6846736775610151994]=[], [2582680286900566733, 2588891414424736172]=[], [-8475287941706663919, -8469715540705797889]=[], [4702944307435693455, 4719031281134601860]=[], [1505166145408500241, 1529215559298962360]=[], [7558259524976519622, 7589259310450757101]=[], [2457068377656749494, 2518963151239571349]=[], [-662620843226419540, -648816152089556760]=[], [1811685704180907092, 1866983848131886172]=[], [906880799052678148, 921207736693901268]=[], [-1256188405096295761, -1251839831017881262]=[], [3506651699717477204, 3509005924571210529]=[], [5904060532436192607, 5922942276556243371]=[], [8335880026770499616, 8335917059173530463]=[], [6998566955207500818, 7015763263441566094]=[], [4307399684438933050, 4322999041213705495]=[], [-6609092260989527881, -6600126709078558353]=[], [8059322415385003331, 8076732515624608701]=[], [-4062915327184017076, -4046699511518079622]=[], [4191269640571890854, 4203853163925490084]=[], [-9080249770355568928, -9063200956908944635]=[], [-631814065810069940, -623688715584221616]=[], [-7660869200973058086, -7646624639571456699]=[], [-2962854858252458557, -2953824875336680415]=[], [-6418668755306402216, -6351235315188280096]=[], [-5647892745631415975, -5644009797308341302]=[], [-1603843621011863418, -1603482665970338357]=[], [1876417635429492045, 1893155383920697859]=[], [-4924490251279821248, -4923877863142114892]=[], [-8361462506805035968, -8353650372536375934]=[], [4250325287347841321, 4267170985874019945]=[], [4612134641152533621, 4619610064126383476]=[], [-7868555664379111545, -7868542706126328701]=[], [6119031588241292905, 6146086992145105572]=[], [-505646614850450365, -486102891606279657]=[], [-1462878341231497146, -1452615416022512616]=[], [2408268696531021204, 2410981699084074123]=[], [943801435354016476, 948414470885543748]=[], [8990666948923936077, 9003094987575547333]=[], [-7061838253575465319, -7039630780308410046]=[], [1253117655404763727, 1256318725157009403]=[], [5179330839568694295, 5184672662900303094]=[], [-6724106150333340926, -6724041062160340709]=[], [3513139307656289127, 3516441224538621500]=[], [3465708221199635625, 3498036162642871789]=[], [6528741294189409016, 6548302136885399016]=[], [-8899566728133865186, -8899290714192025948]=[], [1083594821371023613, 1106697761559329266]=[], [1715278190568603790, 1726516607993845481]=[], [3461205081703141761, 3465708221199635625]=[], [7721136384482281784, 7734576158135262662]=[], [8026743345873120493, 8027977896055985531]=[], [-8812148917309903670, -8784559319761068530]=[], [-8075625381541615307, -8060266246506302962]=[], [-1975033874708932800, -1973718664427524439]=[], [-7962717502982383030, -7943598187509914760]=[], [5399640582801687217, 5403279252363194250]=[], [-1702832184853833674, -1680506190129601621]=[], [8764807191570283161, 8770000187598680596]=[], [332438817315668276, 336852403120333418]=[], [7389816819762951376, 7393420826698086416]=[], [3605548927754165806, 3608126377440011913]=[], [9187798577141093902, 9195965453675475249]=[], [-5690861705648700032, -5690790857306008532]=[], [1805803197128714699, 1811685704180907092]=[], [2029787531917813950, 2033101617298840319]=[], [-6344652383117552975, -6339892976214761973]=[], [-4295978430947398498, -4260725644201221871]=[], [-7034644126950607670, -6978727080305525807]=[], [1617298226732141143, 1618134943813191261]=[], [5131847942196517727, 5157044652716166141]=[], [7050998661204678717, 7103162083982322747]=[], [2043171264515475411, 2066280524359667545]=[], [3814908392648448902, 3860074099310004349]=[], [3325598551729899505, 3340943865480076041]=[], [4501961940135937352, 4521399429357646230]=[], [6014335608779734798, 6046124449921644903]=[], [3972022488430069138, 3973220941796485922]=[], [8264295159130053667, 8282361411225597475]=[], [-2890551887746088603, -2888566595526026688]=[], [3658292606441184720, 3680960737037990642]=[], [-4231722489526295728, -4189902401525590704]=[], [-6296225424064419225, -6285252089317113781]=[], [-2222934870101806198, -2205673561894215716]=[], [-3865575152262825661, -3856228553905702310]=[], [4270742711007831608, 4273862105801589540]=[], [-4564124595870376695, -4563287228328016503]=[], [-3283165459366861359, -3249340825117023169]=[], [3173046240608825950, 3174003194432480352]=[], [-2373847377672482858, -2363951691242349559]=[], [6730248520168442926, 6731197724093043690]=[], [-7292576966841004560, -7232581208743552463]=[], [3874958026732137083, 3932257392466547857]=[], [1256318725157009403, 1262100321431177247]=[], [-3678958354173338857, -3673526562917969902]=[], [924559986490197309, 943801435354016476]=[], [-623688715584221616, -612918450642994690]=[], [-486102891606279657, -465960252674737558]=[], [-699815469576284311, -695833686799280768]=[], [777698140801981474, 778004333013543619]=[], [3303490870760989266, 3325598551729899505]=[], [-8269965932649251183, -8201761003212298481]=[], [-4255215278728230818, -4244858298720462958]=[], [-8894646344406370330, -8884473028078832553]=[], [-3089837964917273827, -3066399449684943945]=[], [-6135846716971543667, -6128769424372044523]=[], [-84663362273789934, -83261333287482341]=[], [-3215395696353078846, -3189012426503304845]=[], [8917676462718890876, 8930630902813048632]=[], [3564320927054922271, 3572776171717641655]=[], [6224960937593489714, 6247778619083953506]=[], [-6507463319982213959, -6506195827697823008]=[], [-6699675242730251345, -6690832607240602953]=[], [-1832217519835529077, -1825310243407932211]=[], [-6464821491112310015, -6418668755306402216]=[], [2606693422494481711, 2611504485045026489]=[], [-2439829940274324050, -2436274371622551964]=[], [-2012241667722995678, -2008977440493730003]=[], [-5157751780714774909, -5117504227621037998]=[], [5806561163628451265, 5831839821834325998]=[], [2554658082322697082, 2569663300344021975]=[], [4089715211574107038, 4090484081282824278]=[], [5846467236833918221, 5854253811140274593]=[], [-8857880558602091425, -8845794254891955023]=[], [-4625544162326249603, -4611754786393053725]=[], [-8420968949991206146, -8420397026677105115]=[], [8185491851540318761, 8202339695520218706]=[], [8076732515624608701, 8089944725458638741]=[], [-6781323620485024869, -6780344315699292376]=[], [-7405726271750241303, -7357685494216847049]=[], [-900751575004035776, -882725617777444514]=[], [4145686518343249194, 4168063025588369973]=[], [-8834976298699024779, -8817582153227691279]=[], [7374532903989328575, 7375715483635666668]=[], [-7872839247241010043, -7868555664379111545]=[], [-5022448406419808087, -4953993286810209089]=[], [-6489371667136489558, -6482138593431599090]=[], [5554776409926992721, 5557462748327930275]=[], [-2312294363823709719, -2306712041928587974]=[], [-6114955094118052322, -6105011368485412949]=[], [5008764345769755334, 5044343553409740146]=[], [-5997392631295530911, -5994488142340287316]=[], [7852341141241434681, 7852749725824012540]=[], [-4873240827374594919, -4829473744604379967]=[], [-8817582153227691279, -8812148917309903670]=[], [4267170985874019945, 4270742711007831608]=[], [-3496490170220558376, -3479880017117824004]=[], [-2449231487716426942, -2446868073202183462]=[], [4800983365297636960, 4801980097566042631]=[], [2217312117454628534, 2232928036564433036]=[], [4791556334204487072, 4800983365297636960]=[], [-524430890406018839, -516164566468219378]=[], [-2128115202370700523, -2121966682156037184]=[], [-4010443936225520423, -3982890185210045501]=[], [-2250150729707074213, -2239012480829371690]=[], [155208214722633207, 183029690912963010]=[], [-4698430307027007341, -4671341321902941796]=[], [7355598039...
djsly commented 9 years ago

Turns out that my replication DC name was wrong when I setup my keyspace. so Cassandra was returning a list of empty listen addresses (end point)

I will let you decide if you prefer to have a better error message in case .values() returns 0. Right now it keeps the repair Run in the Running state for ever due to the aricmetic exception.

chbatey commented 8 years ago

Also hit this. Going to raise a PR to wrap this up in a reaper exception and give a better log message.