Aims: Response of a protoplanetary disk to luminosity bursts of various duration is studied with the purpose to determine the effect of the bursts on the strength and sustainability of gravitational instability in the disk. A special emphasis is paid to the spatial distribution of gas and grown dust (from 1 mm to a few cm) during and after the burst. Methods: Numerical hydrodynamics simulations using the FEOSAD code were employed to study the dynamics of gas and dust in the thin-disk limit. Dust-to-gas friction including back reaction and dust growth were also considered. Bursts of various duration (from 100 to 500 yr) were initiated in accordance with a thermally ignited magnetorotational instability. Luminosity curves for constant- and declining-magnitude bursts were adopted to represent two typical limiting cases for FU-Orionis-type eruptions. Results: The short-term effect of the burst is to reduce the strength of gravitational instability by heating and expanding the disk. The longest bursts with duration comparable to the revolution period of the spiral can completely dissolve the original two-armed spiral pattern in the gas disk by the end of the burst, while the shortest bursts only weaken the spiral pattern. The reaction of grown dust to the burst is somewhat different. The spiral-like initial distribution with deep cavities in the inter-armed regions transforms into a ring-like distribution with deep gaps. This transformation is most expressed for the longest-duration bursts. The long-term effect of the burst depends on the initial disk conditions at the onset of the burst. In some cases, vigorous disk fragmentation sets in several thousand years after the burst, which was absent in the model without the bursts (abridged).