Russia is preparing for the war in Ukraine to continue for years by planning record war spending, abandoning plans to rein in military outlays.