Suppose I am a node in the Bitcoin protocol and I receive a block that does not point to any block in my current chain. Should I keep it on the side, waiting for missing intermediate ones? Should I propagate it? Should I just erase it?
The Bitcoin client used to download blocks without necessarily knowing if they could connect it to their current chain. If it couldn't connect a block to the genesis block, it would just keep it in memory. This was a waste of memory (up to 750 MB could be used up before it started dropping blocks) and bandwidth (if you drop a block that you need, that wastes bandwidth)
It does something smarter now, though. It builds a chain of block headers to the current tip of the chain, then downloads the block contents. Not only is this simpler, and more resource efficient, it also allows you to download multiple blocks in parallel. Blocks are written to disk as soon as they're downloaded.
Since there's no way that you will receive a block that you didn't ask for, the current Bitcoin client will drop the block and permanently disconnect from the peer that sent it.
Blocks that are not yet confirmed look this way, so just wait a bit then try again. Continue checking for x amount of time before declaring it an orphan.
There may even be other blocks that have not been assigned a place in the blockchain that are ahead of it. Most blocks are confirmed pretty quickly, but others can take several minutes.
So far we haven't yet seen clearance times measured in hours. And if the block size is increased simultaneously with the doubling of the work factor this summer (the first since 2012) we may well see ever longer clearance times. So as you encounter these blocks they may be in the pipeline for confirmation.
If you are operating as a full node you will notice them coming through. If you can't confirm then your node won't answer at all. If you are looking at the stream directly be sure to look at when your node chooses to confirm or not.
In other words, don't think you need to do anything manually. Your node knows what to do.