The futures exchange keeps track of the position of all traders. For every long there is a short so that the total amount of contracts long is equal to the total amount short. (We say that the futures contracts are in zero net supply). However the identities behind the positions are changing constantly, I may be long today, tomorrow I may sell my position to another trader and so forth. There is enormous turnover in the positions, a complicated tangle of transactions.
At some point on the calendar the contract becomes deliverable and shorts may send to the exchange a notice of intention to deliver. The exchange needs to find the corresponding long and tell him that he must accept delivery of the commodity.
The question is what method does the exchange use to find the long trader who must accept delivery from trader X who is short?
To a beginner it may seem that the Exchange should simply notify the trader who did the original transaction with trader X: When trader X sold, trader Y bought, so track down trader Y. However, in practice this is almost never done. As mentioned trader Y may have sold his position to trader Z, who may have sold to trader A, etc. It is (or was in the days when computerized search algorithms were less developed) too complicated to search for the counterparty this way; you may have to scan the entire database of transactions.
Instead the exchange uses a different rule. Several are common.
One very simple rule is a random assignment rule: the exchange selects at random someone who is long a contract and informs him that he must take delivery of the commodity from trader X.
This rule is simple but can improved upon by giving traders a higher priority if they have held the long position for a long time. What is sometimes called a first come first served rule. The exchange keeps track of the date and time that each trader's long position was opened (which is very simple to do in a computer system, just store a timestamp next to the current position of each trader), sorts them in order once a day ($O(n \log n)$ time) and selects the trader who has held his long position for the longest time (i.e. the oldest outstanding long position). The exchange notifies this trader that he is subject to delivery.
As the delivery season continues, more and more shorts declare their intention to deliver and the exchange keeps notifying the oldest longs. Eventually even traders who have opened up their positions very recently will find themselves assigned to be delivered.