Snapraid diff - wrong threshold condition?

  • snapraid isn't in the top list because it completed. But there is something wrong because the script doesn't end properly.


    Do you see any reference to markdown in the top list?


    Is there anything related in /tmp?

    --
    Google is your friend and Bob's your uncle!


    OMV AMD64 7.x on headless Chenbro NR12000 1U 1x 8m Quad Core E3-1220 3.1GHz 32GB ECC RAM.

  • snapraid isn't in the top list because it completed. But there is something wrong because the script doesn't end properly.


    Do you see any reference to markdown in the top list?


    Is there anything related in /tmp?


    Previously, I had not yet installed the discount package, nor made the modification you suggested under function send_mail(){

    So I just installed discount, modified the script, re-ran, and no difference. No reference to markdown in top. I don't see anything relevant in /tmp except snapRAID.out


    Here are the contents of /tmp


    Here is the output of top once the script freezes. The only difference is snapraid will show until the script freezes.

  • Look at the end of the /tmp/snapRAID.out file. There may be clues in it.

    --
    Google is your friend and Bob's your uncle!


    OMV AMD64 7.x on headless Chenbro NR12000 1U 1x 8m Quad Core E3-1220 3.1GHz 32GB ECC RAM.

  • Is the script getting far enough to actually send email?

    --
    Google is your friend and Bob's your uncle!


    OMV AMD64 7.x on headless Chenbro NR12000 1U 1x 8m Quad Core E3-1220 3.1GHz 32GB ECC RAM.

  • Is the script getting far enough to actually send email?

    No it is not. And actually it seems snapraid may not be ending correctly. Here is my putty log from the first run of the script, when there were actually differences which snapraid needed to sync.

    You'll see the script halts while snapraid is running. snapraid dropped out of the process list during this first run and the script froze.

    Nothing else ever starts in the process list, only snapraid, which then terminates and the script freezes.

    Snapraid always runs fine manually or via the builtin omv-snapraid-diff script

    I've attached snapScript2.sh. I've appended .txt to the name so it would allow me to upload.


  • SnapRaid will not sync via the script because you have SYNC_WARN_THRESHOLD=-1


    Read the explanation above that setting and set the value accordingly.


    Not sure changing that will solve all the problems, but it should get further.

    --
    Google is your friend and Bob's your uncle!


    OMV AMD64 7.x on headless Chenbro NR12000 1U 1x 8m Quad Core E3-1220 3.1GHz 32GB ECC RAM.

  • SnapRaid will not sync via the script because you have SYNC_WARN_THRESHOLD=-1


    Read the explanation above that setting and set the value accordingly.


    Not sure changing that will solve all the problems, but it should get further.

    Code
    # Set number of warnings before we force a sync job.
    # This option comes in handy when you cannot be bothered to manually
    # start a sync job when DEL_THRESHOLD is breached due to false alarm.
    # Set to 0 to ALWAYS force a sync (i.e. ignore the delete threshold above)
    # Set to -1 to NEVER force a sync (i.e. need to manual sync if delete threshold is breached)
    #SYNC_WARN_THRESHOLD=3
    SYNC_WARN_THRESHOLD=-1

    Let me know if I am interpreting this wrong. The way I understand this is, it will only not sync if the delete threshold specified is exceeded.

    On the first run, I made sure the delete threshold was set above the number of files deleted.


    I do not want a sync forced if the delete threshold is exceeded, which is the whole purpose of using this custom script, because that is exactly what is broken with the built-in omv-snapraid-diff script.

    The built-in script will run regardless if the delete threshold is exceeded, which will cause data loss if the deletions were not intended.


    A sync should run since the delete threshold is not breached / exceeded.

    If the delete threshold is exceeded, a sync will never run, until I investigate and do a manual sync. This is the exact behavior I want.


    That being said, it would be nice if the built-in script was fixed to work correctly.

  • I suggest changing that setting to a positive value and run the script again. Use a large value so you can be sure it will not sync if the delete threshold is reached unless the script is run that large value number of times.


    You can also try another script. I have used this one in the past.


    Externer Inhalt gist.github.com
    Inhalte von externen Seiten werden ohne Ihre Zustimmung nicht automatisch geladen und angezeigt.
    Durch die Aktivierung der externen Inhalte erklären Sie sich damit einverstanden, dass personenbezogene Daten an Drittplattformen übermittelt werden. Mehr Informationen dazu haben wir in unserer Datenschutzerklärung zur Verfügung gestellt.


    If you are convinced the built in script is broken, then report a bug against it.

    --
    Google is your friend and Bob's your uncle!


    OMV AMD64 7.x on headless Chenbro NR12000 1U 1x 8m Quad Core E3-1220 3.1GHz 32GB ECC RAM.

  • Ok, I determined the script was hanging at the end of snapraid diff. Then I started looking at the comments for the script on the github page (something I should have done in the first place). - https://gist.github.com/mtompk…be36064c237da3f39ff5cc49d - I now see that you made some comments on the github page over a year ago. Based on your comments, I actually see that you were having the exact same issue I'm having.

    You, along with a few others, worked through getting a final working version, by doing the following.

    1. Comment out wait throughout the entire script
    2. Install the discount package (A Markdown implementation written in C) to replace the non working "python -m markdown"
    3. Modify the line below, in the script, according to what you provided earlier

    After doing all this, the script is currently running without hanging so far. It made it through snapraid diff, snapraid sync, and is currently scrubbing the array according to my parameters. I will report back if it has any issues once it gets to the markdown section and sends out the email. But I remain optimistic at this point! Thank you for helping me get to this point!

    I've attached the working version for anyone who runs into this.

  • I forgot about the wait commands. But the rest was all good.


    I occasionally get a failure to send the mail and by running markdown on the output file in /tmp it's caused by something it doesn't like in the file, but I don't recall ever finding out what it was.


    You may want to upload your version of the script as a fork.

    --
    Google is your friend and Bob's your uncle!


    OMV AMD64 7.x on headless Chenbro NR12000 1U 1x 8m Quad Core E3-1220 3.1GHz 32GB ECC RAM.

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!