When I do an upsert DML which trigger code will handle it?
Is there a pattern to solve potential duplicate executions if it is 3)?
For records that already exist, it will fire updates. For records that are new, it will fire inserts. As a result, an upsert can cause both insert and update triggers to fire if you have both new and existing records in your upsert, but they both won't fire for the same record.
I've got a feeling that when you upsert records it does the inserts and the updates in separate batches. I can't find this documented though!
So for example you should be able to iterate through Trigger.new in an after insert and be confident that every record in Trigger.new is indeed a newly inserted record.