JUST TWO WEEKS ago Mikhail Gorbachev was saying that the question of how the 100-plus Soviet ethnic groups or ''nationalities'' get along is ''the most fundamental, vital issue of our society.'' He had some generalities at the ready, hailing ''Soviet patriotism'' while decrying ''nationalism,'' ''chauvinism'' and ''attempts at self-isolation'' -- the familiar Kremlin warnings to minorities that think of challenging (Great) Russian domination or confronting each other. As he spoke, nationalistic demonstrations had just taken place in the Baltics, which were brought forcibly under communist rule only in World War II. Earlier there had been protests in Soviet Central Asia. Now there are demonstrations and riots in the Caucasus, where the Bolshevik regime subdued the briefly independent republics of Armenia, Azerbaijan and Georgia after World War I.

It is not simply that the Soviet Union is as vulnerable as any other multinational country to the worldwide reassertion of ethnic concerns, a passion that time and again has shown its contempt for lines drawn on the political map. As the inheritor, expander and still the possessor of the world's largest land empire, the Soviet Union is more vulnerable. ''Nationalities policy'' has taxed the Soviet regime from the start. The Gorbachev version has combined the traditional assertion of centralized Great Russian power with modest nods to ethnic feeling. For Mr. Gorbachev there is a new twist: the decentralization called for by his economic reform gives these restless people a place to exert pressure. Then there are the Islamic currents stirred in the Soviet Union's fast-growing Central Asian Moslem republics by the war in Afghanistan and by revolutionary Iran.

Two weeks ago Mr. Gorbachev was saying that the Kremlin should call a meeting. Events in Armenia and Azerbaijan are forcing the pace. He has had to send troops to enforce a curfew imposed to halt rioting and, meanwhile, is receiving protest leaders and promising a policy review.

The Central Committee was already vigorously debating the overall Gorbachev policy changes. The new unrest will intensify the debate: it touches sensitive chords of political and territorial integrity and of the legitimacy of control by a Great Russian population that is itself becoming a minority. The extent to which his Kremlin foes will be able to use this issue to undermine Mr. Gorbachev is the key question. The issue has that explosive a potential.