Sherlock Season 4: 20 Easter Eggs & References From The Six Thatchers
6. Appointment In Sumatra
Repeatedly mentioned throughout the episode is the ancient Mesopotamian tale known as Appointment in Samarra (the title given to it in the retelling by W. Somerset Maugham).
Not a fan of its depiction of pre-destination and the immutability of death, young Sherlock is said to have written an alternate version of the story - Appointment in Sumatra. In Sherlock's version, the merchant goes to a different city and manages to escape the Grim Reaper.
The namecheck of Sumatra is surely a reference to the Giant Rat of Sumatra, a famous undocumented case first cited in The Adventure of the Sussex Vampire. Interestingly, it was previously mentioned on Sherlock in The Empty Hearse. In that, the fictional tube station that laid under the Houses of Parliament was called Sumatra Road.