At the moment, descendants of Latvians can obtain a temporary residence permit in Latvia for up to 5 years (clause 34 of Part One of Article 23 of the Immigration Law of the Republic of Latvia). Citizens of the Russian Federation also have the same right (clause 13 of Part Two of Article 231 of the Immigration Law).
If during these 5 years they will actually permanently (continuously) reside in Latvia and learn the Latvian language, they can request a permanent residence permit in Latvia (clause 7 of Part One of Article 24 of the Immigration Law).
In order for residence in Latvia to be recognized as continuous, absence from Latvia for 6 months in a row or for a year in total is not allowed.