Getting past corrupted binary log “Error in Log_event::read_log_event():”MySQL Replication - Introduce...

Output visual diagram of picture

C++ lambda syntax

Why does the frost depth increase when the surface temperature warms up?

Most common words in spoken english

Hashing password to increase entropy

New Order #2: Turn My Way

How to preserve electronics (computers, ipads, phones) for hundreds of years?

Exposing a company lying about themselves in a tightly knit industry (videogames) : Is my career at risk on the long run?

What should be the ideal length of sentences in a blog post for ease of reading?

What is the tangent at a sharp point on a curve?

How can a new country break out from a developed country without war?

Travelling in US for more than 90 days

Derivative of an interpolated function

Mac Mini (2018) 10Gb Port Compatibility

python displays `n` instead of breaking a line

Trouble reading roman numeral notation with flats

Why is implicit conversion not ambiguous for non-primitive types?

Did I make a mistake by ccing email to boss to others?

Connection Between Knot Theory and Number Theory

Strange behavior in TikZ draw command

What is the purpose of using a decision tree?

Why doesn't Gödel's incompleteness theorem apply to false statements?

Sort with assumptions

Why can't I get pgrep output right to variable on bash script?



Getting past corrupted binary log “Error in Log_event::read_log_event():”


MySQL Replication - Introduce new Slave to replicationGetting slaves of a master-master setup stopped in syncError reading MySQL 5.5 binary log using mysqlbinlogLooking for an efficient way to fix “Could not parse relay log event entry…” errorWhat max_allowed_packet is big enough, and why do I need to change it?Error 1236 From Master After Restored ReplicationFind the correct entry in myqlbinlog (using Row Based Replication)Replication doesn't resume once it fails to connectexpire_logs_days directive requires change master?1236 On Slave After Master Master Failure













1















I have a binary log that mysqlbinlog chokes on with the error in the title.



The file itself has much more activity after the cited position.



Doing some basic confirmation it's not all garbage by running it through the strings command shows theres legit traffic until the end of the file when it got rotated.



I've seen a similar post about using hexdump to get past an error related to event too large, but in my case mysqlbinlog chokes to continue to get further information. I'm not familiar enough with the binary format to look for what might be a position of a next event it would recognize.



It gives a starting position it can't get past so I have a script running to basically mysqlbinlog --start-position=X incrementing X by one until it returns with a 0 exit code but that looks like it's going to take a month to completely get through everything at this rate.



I tested the POC of this idea on "good parts" by starting it at weird offsets and it returned correctly at the next one it found w/o error.



I'm running percona 5.6.20 for this instance.



I realize this report might be lacking in information needed to answer the question so I'm happy to edit with comment requests as needed.










share|improve this question














bumped to the homepage by Community 2 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.




















    1















    I have a binary log that mysqlbinlog chokes on with the error in the title.



    The file itself has much more activity after the cited position.



    Doing some basic confirmation it's not all garbage by running it through the strings command shows theres legit traffic until the end of the file when it got rotated.



    I've seen a similar post about using hexdump to get past an error related to event too large, but in my case mysqlbinlog chokes to continue to get further information. I'm not familiar enough with the binary format to look for what might be a position of a next event it would recognize.



    It gives a starting position it can't get past so I have a script running to basically mysqlbinlog --start-position=X incrementing X by one until it returns with a 0 exit code but that looks like it's going to take a month to completely get through everything at this rate.



    I tested the POC of this idea on "good parts" by starting it at weird offsets and it returned correctly at the next one it found w/o error.



    I'm running percona 5.6.20 for this instance.



    I realize this report might be lacking in information needed to answer the question so I'm happy to edit with comment requests as needed.










    share|improve this question














    bumped to the homepage by Community 2 mins ago


    This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.


















      1












      1








      1








      I have a binary log that mysqlbinlog chokes on with the error in the title.



      The file itself has much more activity after the cited position.



      Doing some basic confirmation it's not all garbage by running it through the strings command shows theres legit traffic until the end of the file when it got rotated.



      I've seen a similar post about using hexdump to get past an error related to event too large, but in my case mysqlbinlog chokes to continue to get further information. I'm not familiar enough with the binary format to look for what might be a position of a next event it would recognize.



      It gives a starting position it can't get past so I have a script running to basically mysqlbinlog --start-position=X incrementing X by one until it returns with a 0 exit code but that looks like it's going to take a month to completely get through everything at this rate.



      I tested the POC of this idea on "good parts" by starting it at weird offsets and it returned correctly at the next one it found w/o error.



      I'm running percona 5.6.20 for this instance.



      I realize this report might be lacking in information needed to answer the question so I'm happy to edit with comment requests as needed.










      share|improve this question














      I have a binary log that mysqlbinlog chokes on with the error in the title.



      The file itself has much more activity after the cited position.



      Doing some basic confirmation it's not all garbage by running it through the strings command shows theres legit traffic until the end of the file when it got rotated.



      I've seen a similar post about using hexdump to get past an error related to event too large, but in my case mysqlbinlog chokes to continue to get further information. I'm not familiar enough with the binary format to look for what might be a position of a next event it would recognize.



      It gives a starting position it can't get past so I have a script running to basically mysqlbinlog --start-position=X incrementing X by one until it returns with a 0 exit code but that looks like it's going to take a month to completely get through everything at this rate.



      I tested the POC of this idea on "good parts" by starting it at weird offsets and it returned correctly at the next one it found w/o error.



      I'm running percona 5.6.20 for this instance.



      I realize this report might be lacking in information needed to answer the question so I'm happy to edit with comment requests as needed.







      mysql replication mysql-5.6 disaster-recovery






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Feb 10 '17 at 2:16









      atxdbaatxdba

      3,89842654




      3,89842654





      bumped to the homepage by Community 2 mins ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







      bumped to the homepage by Community 2 mins ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
























          1 Answer
          1






          active

          oldest

          votes


















          0














          Well much to my surprise the script I mentioned did find a good starting position and I was able to successfully recover a large portion of the binary log after the problem point.



          Not the most elegant script but in case it's of use to anyone else. Note it is very slow restarting a new process to scan byte by byte but got me results.



          And yes I recognize the potential of infinite looping by never finding anything, might want to add additional check based on start position vs filesize



          #!/bin/bash
          BINLOG=$1
          START=$2


          RET=1
          while [ $RET -eq 1 ]; do
          # This is relying on the mysqlbinlog found in your path
          # You'll want to make sure this resolves to a binary version matching the mysqld that generated the binlog
          mysqlbinlog --start-position=$START $BINLOG > /dev/null 2>&1
          RET=$?

          START=$(( START + 1 ))
          if [[ $(( START % 1000 )) -eq 0 ]]; then
          echo $START
          fi
          done
          GOODSTART=$(( START -1 ))

          echo "FOUND GOOD START AT $GOODSTART"

          # Saving it to a file in case youre running it overnight, script is very slow.
          echo $GOODSTART > ${BINLOG}.goodstartposition





          share|improve this answer























            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "182"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f163834%2fgetting-past-corrupted-binary-log-error-in-log-eventread-log-event%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            Well much to my surprise the script I mentioned did find a good starting position and I was able to successfully recover a large portion of the binary log after the problem point.



            Not the most elegant script but in case it's of use to anyone else. Note it is very slow restarting a new process to scan byte by byte but got me results.



            And yes I recognize the potential of infinite looping by never finding anything, might want to add additional check based on start position vs filesize



            #!/bin/bash
            BINLOG=$1
            START=$2


            RET=1
            while [ $RET -eq 1 ]; do
            # This is relying on the mysqlbinlog found in your path
            # You'll want to make sure this resolves to a binary version matching the mysqld that generated the binlog
            mysqlbinlog --start-position=$START $BINLOG > /dev/null 2>&1
            RET=$?

            START=$(( START + 1 ))
            if [[ $(( START % 1000 )) -eq 0 ]]; then
            echo $START
            fi
            done
            GOODSTART=$(( START -1 ))

            echo "FOUND GOOD START AT $GOODSTART"

            # Saving it to a file in case youre running it overnight, script is very slow.
            echo $GOODSTART > ${BINLOG}.goodstartposition





            share|improve this answer




























              0














              Well much to my surprise the script I mentioned did find a good starting position and I was able to successfully recover a large portion of the binary log after the problem point.



              Not the most elegant script but in case it's of use to anyone else. Note it is very slow restarting a new process to scan byte by byte but got me results.



              And yes I recognize the potential of infinite looping by never finding anything, might want to add additional check based on start position vs filesize



              #!/bin/bash
              BINLOG=$1
              START=$2


              RET=1
              while [ $RET -eq 1 ]; do
              # This is relying on the mysqlbinlog found in your path
              # You'll want to make sure this resolves to a binary version matching the mysqld that generated the binlog
              mysqlbinlog --start-position=$START $BINLOG > /dev/null 2>&1
              RET=$?

              START=$(( START + 1 ))
              if [[ $(( START % 1000 )) -eq 0 ]]; then
              echo $START
              fi
              done
              GOODSTART=$(( START -1 ))

              echo "FOUND GOOD START AT $GOODSTART"

              # Saving it to a file in case youre running it overnight, script is very slow.
              echo $GOODSTART > ${BINLOG}.goodstartposition





              share|improve this answer


























                0












                0








                0







                Well much to my surprise the script I mentioned did find a good starting position and I was able to successfully recover a large portion of the binary log after the problem point.



                Not the most elegant script but in case it's of use to anyone else. Note it is very slow restarting a new process to scan byte by byte but got me results.



                And yes I recognize the potential of infinite looping by never finding anything, might want to add additional check based on start position vs filesize



                #!/bin/bash
                BINLOG=$1
                START=$2


                RET=1
                while [ $RET -eq 1 ]; do
                # This is relying on the mysqlbinlog found in your path
                # You'll want to make sure this resolves to a binary version matching the mysqld that generated the binlog
                mysqlbinlog --start-position=$START $BINLOG > /dev/null 2>&1
                RET=$?

                START=$(( START + 1 ))
                if [[ $(( START % 1000 )) -eq 0 ]]; then
                echo $START
                fi
                done
                GOODSTART=$(( START -1 ))

                echo "FOUND GOOD START AT $GOODSTART"

                # Saving it to a file in case youre running it overnight, script is very slow.
                echo $GOODSTART > ${BINLOG}.goodstartposition





                share|improve this answer













                Well much to my surprise the script I mentioned did find a good starting position and I was able to successfully recover a large portion of the binary log after the problem point.



                Not the most elegant script but in case it's of use to anyone else. Note it is very slow restarting a new process to scan byte by byte but got me results.



                And yes I recognize the potential of infinite looping by never finding anything, might want to add additional check based on start position vs filesize



                #!/bin/bash
                BINLOG=$1
                START=$2


                RET=1
                while [ $RET -eq 1 ]; do
                # This is relying on the mysqlbinlog found in your path
                # You'll want to make sure this resolves to a binary version matching the mysqld that generated the binlog
                mysqlbinlog --start-position=$START $BINLOG > /dev/null 2>&1
                RET=$?

                START=$(( START + 1 ))
                if [[ $(( START % 1000 )) -eq 0 ]]; then
                echo $START
                fi
                done
                GOODSTART=$(( START -1 ))

                echo "FOUND GOOD START AT $GOODSTART"

                # Saving it to a file in case youre running it overnight, script is very slow.
                echo $GOODSTART > ${BINLOG}.goodstartposition






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Feb 11 '17 at 1:11









                atxdbaatxdba

                3,89842654




                3,89842654






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Database Administrators Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f163834%2fgetting-past-corrupted-binary-log-error-in-log-eventread-log-event%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Anexo:Material bélico de la Fuerza Aérea de Chile Índice Aeronaves Defensa...

                    Always On Availability groups resolving state after failover - Remote harden of transaction...

                    update json value to null Announcing the arrival of Valued Associate #679: Cesar Manara ...