If none of this helps, i would, if at all possible, make an appointment with a veterinarian who is a board certified gi specialist. Try to feel for the swelling, and squeeze it. While anal glands empty routinely during defecation, there are other circumstances where the anal glands will actually empty spontaneously. If the glands are not drained, they may abscess (fill with pus which is made of dead bacteria and dead white blood cells ). Nonetheless, the reported 80% success rate of tail amputation for treating anal furunculosis in gsds suggests that the tail confirmation defect of gsds is involved to some extent (elkins 2004).
For more information
Certain breeds are worse affected than others, though any breed can get problems. Yes there is, a surgical operation where the anal glands are removed entirely.