That sounds like the simile in AN 3.130 below.
This describes three types of individuals and their anger. Anger is a sankhara (volition, mental formation).
"Monks, there are these three types of individuals to be found
existing in the world. Which three? An individual like an inscription
in rock, an individual like an inscription in soil, and an individual
like an inscription in water.
"And how is an individual like an inscription in rock? There is the
case where a certain individual is often angered, and his anger stays
with him a long time. Just as an inscription in rock is not quickly
effaced by wind or water and lasts a long time, in the same way a
certain individual is often angered, and his anger stays with him a
long time. This is called an individual like an inscription in rock.
"And how is an individual like an inscription in soil? There is the
case where a certain individual is often angered, but his anger
doesn't stay with him a long time. Just as an inscription in soil is
quickly effaced by wind or water and doesn't last a long time, in the
same way a certain individual is often angered, but his anger doesn't
stay with him a long time. This is called an individual like an
inscription in soil.
"And how is an individual like an inscription in water? There is the
case where a certain individual — when spoken to roughly, spoken to
harshly, spoken to in an unpleasing way — is nevertheless congenial,
companionable, & courteous. Just as an inscription in water
immediately disappears and doesn't last a long time, in the same way a
certain individual — when spoken to roughly, spoken to harshly, spoken
to in an unpleasing way — is nevertheless congenial, companionable, &
courteous. This is called an individual like an inscription in water.
"These are the three types of individuals to be found existing in the
world."
AN 3.130