On 8 January 2013 22:31, Kent Borg <kent.b...@csr.com> wrote:
> I think so.  Let me restate what I think I know.
>
> If I use the command line "snmpset" to set a bunch of variables,
> I am (nearly*) guaranteed that either they all happen or none of them do.

If you issue a single snmpset command with several assignments,
then yes - they should all happen, or none of them should.

> * "nearly"? Well, if I error in the COMMIT, what can net-snmp do?
> If I (and every other handler) never errors out of the COMMIT, then the 
> guarantee can be met.

Which is why the assignment should normally be made in the ACTION pass
(unless you are 100% sure that it cannot possibly fail - in which case
 it's OK to do this in the COMMIT pass)


> So if I set foo to 3 and bar to 7, handle_foo() will get a RESERVE1, 
> RESERVE2, etc.
>  handle_bar will get a RESERVE1, RESERVE2, etc

Strictly speaking:
    handle_foo will get a RESERVE1
    handle_bar will get a RESERVE1
    handle_foo will get a RESERVE2
    handle_bar will get a RESERVE2
    handle_foo will get a ACTION
    handle_bar will get a ACTION
    handle_foo will get a COMMIT
    handle_bar will get a COMMIT

>  If neither returns any error, net-snmp assumes that all will work and calls 
> handle_foo()
> with a COMMIT and calls handle_bar() with COMMIT.

You've missed out the ACTION pass, but essentially yes.

>  If there is a problem, the UNDO and FREE (or FREE and UNDO)
> are called and no COMMITs are called.

If either of the RESERVE passes fails, then FREE will be called
  (and neither ACTION nor COMMIT will be)
If the ACTION pass fails, then UNDO will be called (but COMMIT won't)


> Which means if two different snmpset's are done, one will get in first
> and either backout or succeed before the second gets a chance to happen.
>  Correct?

Correct.

> You pointed out the case of two different sets of the same variable
> in a single snmpset might interfere.  Well, that is perverse

<curtseys>
Why thank you, kind sir!

> and I think not a case I need to handle "correctly" (because it is poorly
> defined what would be correct), but merely not crash or corrupt.
>
> Right?

I would say that as long as the agent either assigns one of the two
requested values (and it doesn't really matter which one) or returns
an error (probably 'inconsistentValue'), then that should be fine.

Dave

------------------------------------------------------------------------------
Master SQL Server Development, Administration, T-SQL, SSAS, SSIS, SSRS
and more. Get SQL Server skills now (including 2012) with LearnDevNow -
200+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
SALE $99.99 this month only - learn more at:
http://p.sf.net/sfu/learnmore_122512
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Reply via email to