Dear fearpanick,
I'm so sorry to hear you're feeling unwell
The first thought that came to my mind when reading your post was that you sound very anxious about the stomach symptoms, and that maybe this is the cause of your current forgetfulness.. The timing seems to match as well since you say your stomach has been bothering you for a couple of weeks, and the forgetfulness has come about in the past week or so.
I've suffered from Irritable Bowel Syndrome for 15 years so have loads of experience with (unexplained) stomach symptoms and know first-hand how scary it can be. How was your gastritis diagnosed? Did you have a gastroscopy? If yes, then I'd say you can probably rest assured than nothing as bad as cancer will have had time to develop since August. However, seeing as you're so worried, I'd give your doctor a call and let them know that your symptoms have got worse and see if they think more tests are needed.
As for the forgetfulness, have you had any other symptoms such as headaches, dizziness, changes in vision..? I know stress and anxiety can cause very real and terrifying symptoms. Whenever I'm worried about something, I become very disoriented and my head'll be all over the place. It's quite understandable, really, as no matter what I'm up to in the current moment, a lot of my thoughts will be on whatever is troubling me, and less focus will be put on what I'm doing right now. I doubt there's anything seriously wrong, but if you can't shake the worry, then do mention these symptoms to your doctor as well. It's worth it to get peace of mind!
I hope you feel better soon!