neondatabase / neon

Neon: Serverless Postgres. We separated storage and compute to offer autoscaling, code-like database branching, and scale to zero.
https://neon.tech
Apache License 2.0
14.28k stars 408 forks source link

pageserver: implement Serialize for SystemTime with RFC3339 format #7151

Closed jcsp closed 5 months ago

jcsp commented 5 months ago

Since https://github.com/neondatabase/neon/pull/7131 we have two places that use a helper (ser_rfc3339_millis) to get serde to string-ize SystemTimes into the format we want.

It would be nice to just have a Serialize implementation so that we don't have to decorate structs.

kevinmingtarja commented 5 months ago

Hi, I'd like to contribute to this!

jcsp commented 5 months ago

Thanks, feel free to open a PR

kevinmingtarja commented 5 months ago

Hi @jcsp, it seems like there's one other place that uses a helper to serialize/deserialize SystemTime <-> RFC3339. Should we change this too?

https://github.com/neondatabase/neon/blob/94138c1a28e998b6e0d70f3b72dc170b2af34ca6/libs/utils/src/pageserver_feedback.rs#L30-L31

https://github.com/neondatabase/neon/blob/94138c1a28e998b6e0d70f3b72dc170b2af34ca6/libs/utils/src/pageserver_feedback.rs#L164-L187