Skip to content

Commit 2c6770b

Browse files
committed
CLDSRV-769: Add raftSessionId to BucketInfo
raftSesssionId will be logged for access logging.
1 parent a15a21a commit 2c6770b

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

lib/metadata/metadataUtils.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,8 @@ function standardMetadataValidateBucketAndObj(params, actionImplicitDenies, log,
196196
if (getDeleteMarker) {
197197
getOptions.getDeleteMarker = true;
198198
}
199-
return metadata.getBucketAndObjectMD(bucketName, objectKey, getOptions, log, (err, getResult) => {
199+
return metadata.getBucketAndObjectMD(bucketName, objectKey, getOptions, log,
200+
(err, getResult, raftSessionId) => {
200201
if (err) {
201202
// if some implicit iamAuthzResults, return AccessDenied
202203
// before leaking any state information
@@ -205,12 +206,15 @@ function standardMetadataValidateBucketAndObj(params, actionImplicitDenies, log,
205206
}
206207
return next(err);
207208
}
208-
return next(null, getResult);
209+
return next(null, getResult, raftSessionId);
209210
});
210211
},
211-
(getResult, next) => {
212+
(getResult, raftSessionId, next) => {
212213
const bucket = getResult.bucket ?
213214
BucketInfo.deSerialize(getResult.bucket) : undefined;
215+
if (raftSessionId !== undefined) {
216+
bucket.setRaftSessionId(raftSessionId);
217+
}
214218
if (!bucket) {
215219
log.debug('bucketAttrs is undefined', {
216220
bucket: bucketName,

0 commit comments

Comments
 (0)