Re: ci: CCache churns through available space too quickly

Andres Freund <andres@anarazel.de>

From: Andres Freund <andres@anarazel.de>
To: Nazir Bilal Yavuz <byavuz81@gmail.com>
Cc: pgsql-hackers@postgresql.org, Jacob Champion <jacob.champion@enterprisedb.com>, Thomas Munro <thomas.munro@gmail.com>
Date: 2026-06-08T19:28:10Z
Lists: pgsql-hackers
Hi,

On 2026-06-08 19:10:46 +0300, Nazir Bilal Yavuz wrote:
> On Mon, 8 Jun 2026 at 17:59, Andres Freund <andres@anarazel.de> wrote:
> > > diff --git a/src/tools/ci/gha_ccache_decide.py
> > > b/src/tools/ci/gha_ccache_decide.py
> > > new file mode 100644
> > > index 00000000000..920f7bf9685
> > > --- /dev/null
> > > +++ b/src/tools/ci/gha_ccache_decide.py
> >
> > > +    # If there were either barely any misses, or the cache hit ratio was high,
> > > +    # there no point in generating a new cache entry. We have limited cache
> > > +    # space.
> > > +    should_save = misses > 10 and hit_pct < target_rate
> > >
> > > We consider misses here but we don't mention it
> >
> > I was trying to mention it, via "If there were either barely any misses".
> 
> Sorry, what I meant was we don't mention in the logs, which is:
> 
> +    if not should_save:
> +        print(f"hit rate {hit_pct} is above target of {target_rate},
> skip creating new cache entry")
> +        return 0

Ah, makes sense.

I updated that, and after doing some minor polishing, pushed it.

Thanks for the quick review!

Greetings,

Andres



Commits

  1. ci: Improve ccache handling