Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BookKeeper Crashes unexpectedly #258

Closed
estebangarcia opened this issue Mar 1, 2017 · 4 comments
Closed

BookKeeper Crashes unexpectedly #258

estebangarcia opened this issue Mar 1, 2017 · 4 comments
Labels
type/bug The PR fixed a bug or issue reported a bug
Milestone

Comments

@estebangarcia
Copy link

estebangarcia commented Mar 1, 2017

Hi. We had a couple of bookkeepers that crashed unexpectedly at different moments. We gathered the logs before the crash, I'm attaching them. Any help will be much appreciated.

Thanks
bklogs.txt

@merlimat
Copy link
Contributor

merlimat commented Mar 2, 2017

It looks like there are failures related to the DataSketches stats library :

java.lang.ArrayIndexOutOfBoundsException: 256
        at com.yahoo.sketches.quantiles.DoublesUpdateImpl.zipSize2KBuffer(DoublesUpdateImpl.java:127)
        at com.yahoo.sketches.quantiles.DoublesUpdateImpl.inPlacePropagateCarry(DoublesUpdateImpl.java:92)
        at com.yahoo.sketches.quantiles.DoublesUpdateImpl.processFullBaseBuffer(DoublesUpdateImpl.java:46)
        at com.yahoo.sketches.quantiles.HeapDoublesSketch.update(HeapDoublesSketch.java:176)
        at org.apache.bokkeeper.stats.datasketches.DataSketchesOpStatsLogger.registerSuccessfulEvent(DataSketchesOpStatsLogger.java:59)
        at org.apache.bookkeeper.bookie.Journal.run(Journal.java:895)

This exception is happening in the Journal thread and causes the bookie process to restart.

Other exception during the stats collection :

2017-02-26 17:59:56,096 - WARN  - [metrics-1-1:DataSketchesMetricsProvider@76] - Failed to report stats: 128
java.lang.ArrayIndexOutOfBoundsException: 128
        at com.yahoo.sketches.quantiles.DoublesAuxiliary.populateFromQuantilesSketch(DoublesAuxiliary.java:99)
        at com.yahoo.sketches.quantiles.DoublesAuxiliary.<init>(DoublesAuxiliary.java:38)
        at com.yahoo.sketches.quantiles.DoublesSketch.constructAuxiliary(DoublesSketch.java:607)
        at com.yahoo.sketches.quantiles.DoublesSketch.getQuantile(DoublesSketch.java:195)
        at org.apache.bokkeeper.stats.datasketches.DataSketchesOpStatsLogger.getMedian(DataSketchesOpStatsLogger.java:121)
        at org.apache.bokkeeper.stats.datasketches.JsonFileReporter.lambda$report$9(JsonFileReporter.java:67)
        at java.util.concurrent.ConcurrentSkipListMap.forEach(ConcurrentSkipListMap.java:3252)
        at org.apache.bokkeeper.stats.datasketches.JsonFileReporter.report(JsonFileReporter.java:61)
        at org.apache.bokkeeper.stats.datasketches.DataSketchesMetricsProvider.lambda$null$5(DataSketchesMetricsProvider.java:74)

As a workaround, you can fallback a different stats implementation for the bookies, eg:

statsProviderClass=org.apache.bookkeeper.stats.CodahaleMetricsProvider
codahaleStatsJmxEndpoint=metrics

and collect the stats through JMX. Or comment statsProviderClass to disable stats

@merlimat merlimat added the type/bug The PR fixed a bug or issue reported a bug label Mar 2, 2017
@merlimat merlimat added this to the 1.17 milestone Mar 2, 2017
@merlimat
Copy link
Contributor

merlimat commented Mar 2, 2017

I don't understand the specific exceptions. Need to dig a bit into that code or ask help to DataSketches people.

@estebangarcia
Copy link
Author

Thanks for your response. We'll disable the stats for now.

@merlimat
Copy link
Contributor

merlimat commented Mar 2, 2017

There seems to be a concurrency issue in the stats provider that makes 2 threads seeing inconsistent internal state and thus throw exception. I'll send a fix in the bookkeeper repo branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug The PR fixed a bug or issue reported a bug
Projects
None yet
Development

No branches or pull requests

2 participants