Skip to content

Commit d217387

Browse files
committed
Merge branch 'master' into feature/LOG-18882
This pulls in recent additions from the master branch.
2 parents c05f969 + 9728bcd commit d217387

File tree

5 files changed

+52
-5
lines changed

5 files changed

+52
-5
lines changed

MEZMO_CHANGELOG.md

+19
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
## [1.32.1](https://github.com/answerbook/vector/compare/v1.32.0...v1.32.1) (2023-12-22)
2+
3+
4+
### Bug Fixes
5+
6+
* Use buffer ref to account for event size in transforms [9842893](https://github.com/answerbook/vector/commit/9842893dd0db567c2604a64c181dee3833fce55b) - Jorge Bay [LOG-18897](https://logdna.atlassian.net/browse/LOG-18897)
7+
8+
# [1.32.0](https://github.com/answerbook/vector/compare/v1.31.0...v1.32.0) (2023-12-21)
9+
10+
11+
### Features
12+
13+
* **s3-sink**: file consolidation off default [fb46e73](https://github.com/answerbook/vector/commit/fb46e7359b442466069e1fc89d24254821b2a869) - dominic-mcallister-logdna [LOG-18535](https://logdna.atlassian.net/browse/LOG-18535)
14+
15+
16+
### Miscellaneous
17+
18+
* Merge pull request #378 from answerbook/dominic/LOG-18535-defaultoff [af67c9e](https://github.com/answerbook/vector/commit/af67c9e1af1bc4bb6d5add3ea88888709f500f38) - GitHub [LOG-18535](https://logdna.atlassian.net/browse/LOG-18535)
19+
120
# [1.31.0](https://github.com/answerbook/vector/compare/v1.30.0...v1.31.0) (2023-12-20)
221

322

lib/vector-core/src/transform/mod.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -272,14 +272,16 @@ impl TransformOutputs {
272272
usage_tracker: &dyn OutputUsageTracker,
273273
) -> Result<(), Box<dyn error::Error + Send + Sync>> {
274274
if let Some(primary) = self.primary_output.as_mut() {
275-
let send_buf = buf.primary_buffer.as_mut().expect("mismatched outputs");
276-
Self::send_single_buffer(send_buf, primary).await?;
277-
275+
// Use the reference of the buffer FIRST to get the original value
276+
// to calculate counts/sizes
278277
let usage_profile = buf.primary_buffer.as_ref().map_or(Default::default(), |o| {
279278
o.0.iter()
280279
.map(|a| usage_tracker.get_size_and_profile(a))
281280
.sum()
282281
});
282+
283+
let send_buf = buf.primary_buffer.as_mut().expect("mismatched outputs");
284+
Self::send_single_buffer(send_buf, primary).await?;
283285
// We only want to track the primary transform output.
284286
// Named outputs are for stuff like route/swimlanes that we don't want to track atm.
285287
// We only want to capture the traffic of the remap transform after the node representing

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vector",
3-
"version": "1.31.0",
3+
"version": "1.32.1",
44
"description": "Vector is a high-performance, end-to-end (agent & aggregator) observability data pipeline",
55
"repository": {
66
"type": "git",

src/sinks/aws_s3/file_consolidator_async.rs

+10
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,11 @@ impl FileConsolidatorAsync {
8888
}
8989

9090
pub fn start(&mut self) -> bool {
91+
// default situation so the config isn't enabled
92+
if !self.file_consolidation_config.enabled {
93+
return false;
94+
}
95+
9196
if self.join_handle.is_some() {
9297
info!(
9398
message =
@@ -192,6 +197,11 @@ impl FileConsolidatorAsync {
192197
}
193198

194199
pub fn stop(&mut self) -> bool {
200+
// default situation so the config isn't enabled
201+
if !self.file_consolidation_config.enabled {
202+
return false;
203+
}
204+
195205
info!(
196206
message = "Triggering shutdown for S3 file consolidation",
197207
bucket = self.bucket,

src/sinks/aws_s3/integration_tests_mezmo.rs

+17-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ async fn s3_message_objects_not_reshaped_because_of_env() {
144144
}
145145

146146
#[tokio::test]
147-
async fn s3_file_consolidator_run() {
147+
async fn s3_file_consolidator_enabled_run() {
148148
let _cx = SinkContext::new_test();
149149
let bucket = uuid::Uuid::new_v4().to_string();
150150

@@ -179,6 +179,22 @@ async fn s3_file_consolidator_run() {
179179
assert_eq!(stopped, true, "stopped true");
180180
}
181181

182+
#[tokio::test]
183+
async fn s3_file_consolidator_disabled_run() {
184+
let _cx = SinkContext::new_test();
185+
186+
// testing the default scenario where the consolidator is disabled
187+
let mut fc: FileConsolidatorAsync = Default::default();
188+
189+
let started = fc.start();
190+
assert!(!started, "started false");
191+
192+
thread::sleep(time::Duration::from_millis(1000));
193+
194+
let stopped = fc.stop();
195+
assert!(!stopped, "stopped false");
196+
}
197+
182198
#[tokio::test]
183199
async fn s3_file_consolidation_process_no_files() {
184200
let _cx = SinkContext::new_test();

0 commit comments

Comments
 (0)