pg.ddx.io  pgbackrest/pgbackrest GitHub issues and pull requests  
help / color / mirror / Atom feed
From: qinruyao (@qinruyao) <noreply+qinruyao@github.com>
To: pgbackrest/pgbackrest <noreply+pgbackrest-pgbackrest@github.com>
Subject: Re: [pgbackrest/pgbackrest] PR #2896: Add S3 KMS encryption context option.
Date: Wed, 04 Nov 2026 19:17:44 +0000
Message-ID: <gh-pgbackrest-pgbackrest-2896-rc4472166486@github.com> (raw)
In-Reply-To: <gh-pgbackrest-pgbackrest-2896-rc4468833752@github.com>
References: <gh-pgbackrest-pgbackrest-2896@github.com>
	<gh-pgbackrest-pgbackrest-2896-rc4468833752@github.com>

(on src/storage/s3/storage.c:1411)

The memory-context macros freed the intermediate objects immediately. Since this runs once per storage instance, I’ve removed them to simplify the code in the new PR iteration.

I kept the two statements because BUFSTR expands its argument three times. Inlining the conversion would repeat the map copy and JSON serialization three times. Using a local variable evaluates that expression once:
```
const String *const context = jsonFromVar(varNewKv(kvDup(kmsEncryptionContext)));
this->kmsEncryptionContext = strNewEncode(encodingBase64, BUFSTR(context));
```

view thread (22+ messages)  latest in thread

Message-ID: <gh-pgbackrest-pgbackrest-2896-rc4472166486@github.com>
Permalink:  ../gh-pgbackrest-pgbackrest-2896-rc4472166486@github.com/

 · 


This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox