I want to seek to a few hours back every few hours to prevent messages lost because of complicated processing logic. Should I stop consuming before seeking of subscription or it is safe to seek while consuming?
TL;DR
No
Explanation
AFAIK the seek operation in Google Pub/Sub allows you to rewind the subscription's cursor to a specific message or a specific point in time. So you can seek to a specific message while the subscription is actively consuming messages.
When you perform a seek operation, the subscription's cursor is moved to the specified message or time, and the next message that is consumed will be the one immediately following the seek position. This allows you to effectively skip over messages that you are not interested in processing.