This was probably We by Yevgeny Zamyatin. Zamyatin, an Old Bolshevik, wrote the novel in 1921 in post-revolutionary Russia (before it was even known as the "Soviet Union"), in part as an expression of his dissatisfaction with how the revolution was proceeding, especially the advancing authoritarianism. The novel-length prose poem tells of a dystopian future with a totalitarian communistic One State—with universal surveillance through glass-walled buildings, fictitious elections, and an absolute ruler with a strong cult of personality. He tried to get it published in Russia, but it was one of the first works banned under the systematic censorship regime that the Communist Party had developed.
From he plot summary, per Wikipedia:
One thousand years after the One State's conquest of the entire world, the spaceship Integral is being built in order to invade and conquer extraterrestrial planets. Meanwhile, the project's chief engineer, D-503, begins a journal that he intends to be carried upon the completed spaceship.
Like all other citizens of One State, D-503 lives in a glass apartment building and is carefully watched by the secret police, or Bureau of Guardians. D-503's lover, O-90, has been assigned by One State to visit him on certain nights. She is considered too short to bear children and is deeply grieved by her state in life.
While on an assigned walk with O-90, D-503 meets a woman named I-330. I-330 smokes cigarettes, drinks alcohol, and shamelessly flirts with D-503 instead of applying for an impersonal sex visit; all of these are highly illegal according to the laws of One State.
Both repelled and fascinated, D-503 struggles to overcome his attraction to I-330. I-330 invites him to visit the Ancient House, notable for being the only opaque building in One State, except for windows. Objects of aesthetic and historical importance dug up from around the city are stored there. There, I-330 offers him the services of a corrupt doctor to explain his absence from work. Leaving in horror, D-503 vows to denounce her to the Bureau of Guardians, but finds that he cannot.
In his last journal entry, D-503 indifferently relates that he has been forcibly tied to a table and subjected to the "Great Operation", which has recently been mandated for all citizens of One State in order to prevent possible riots; having been psycho-surgically refashioned into a state of mechanical "reliability", they would now function as "tractors in human form". This operation removes the imagination and emotions by targeting parts of the brain with X-rays. After this operation, D-503 willingly informed the Benefactor about the inner workings of the Mephi. However, D-503 expresses surprise that even torture could not induce I-330 to denounce her comrades. Despite her refusal, I-330 and those arrested with her have been sentenced to death, "under the Benefactor's Machine".
Now, this is a pretty obvious work, and it was mentioned in the comments back around when this question was first asked. However, it was never given as an answer, presumably because the novel does not show the One State falling at the end. The battle between the One State and the Mephi rebels in ongoing, and the outcome is uncertain. However, the last sentence of the Wikipedia synopsis identifies one of the author's the key philosophical points: that the One State's tyranny cannot survive forever. Whether this revolution overthrows it, or the next one, or the one after that, it will eventually fall.
Meanwhile, the Mephi uprising gathers strength; parts of the Green Wall have been destroyed, birds are repopulating the city, and people start committing acts of social rebellion. Although D-503 expresses hope that the Benefactor shall restore "reason", the novel ends with One State's survival in doubt. I-330's mantra is that, just as there is no highest number, there can be no final revolution.