Skip to content

[Load-CDK] Pre-speed cleanup; Remove dead old interface code - #59735

Merged
Johnny Schmidt (johnny-schmidt) merged 1 commit into
masterfrom
jschmidt/load-cdk/pre-speed-cleanup-5-remove-old-interface-code
May 12, 2025
Merged

Johnny Schmidt (johnny-schmidt) merged 1 commit into
masterfrom
jschmidt/load-cdk/pre-speed-cleanup-5-remove-old-interface-code

Conversation

@johnny-schmidt

@johnny-schmidt Johnny Schmidt (johnny-schmidt) commented May 8, 2025 •

Copy link
Copy Markdown
Contributor

What

NON-Functional Change
Removes all the code from the load CDK that constituted the "old interface"

  • the old pipeline: spillToDisk -> processRecords -> processBatch
  • all its support tasks (FlushTick, FlushCheckpoints, etc)
  • old routing branch from the input consumer
  • old-style range-based checkpointing from the checkpoint/stream managers
  • old branches from the DestinationTaskLauncher
  • some old queues, etc

Notes

This is entirely just cutting unused stuff, with a couple of small exceptions

  • to accomodate two checkpoint styles, we pass the index (for ranges) and the checkpointId (new style) around in an overloaded long; I changed the names/signatures to eliminate confusion
  • there were some old-interface tests that lacked new interface counterparts, so I converted them (most notably RecordToPartAccumulatorTest -> ObjectLoaderPartFormatterTest and PartToObjectAccumulatorTest -> ObjectLoaderPartLoaderTest)

Connectors affected

This is entirely cdk code, except for MSSQL, where there was still some dead code using the old interface I hadn't pruned yet. So there will be a NOP MSSQL release

Not in scope

  • removing old task interfaces (that comes next)
  • merging mergeable old/new style tests (later)
  • cleanup/reorganizing

Testing

  • CDK and toolkit tests pass
  • connector unit tests pass
  • connector integration tests pass

Releasing

This is blocked by Moving Legacy File XFer to the New Interface, which is pending one cloud migration

@johnny-schmidt
Johnny Schmidt (johnny-schmidt) requested a review from a team as a code owner May 8, 2025 23:26
@vercel

vercel Bot commented May 8, 2025 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
airbyte-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 12, 2025 6:27pm

@github-actions

github-actions Bot commented May 8, 2025

Copy link
Copy Markdown
Contributor

destination-dev-null Connector Test Results

  6 files   6 suites   3m 19s ⏱️
100 tests 68 ✅ 32 💤 0 ❌
108 runs  76 ✅ 32 💤 0 ❌

Results for commit 9d719e19.

@github-actions

github-actions Bot commented May 8, 2025 •

Copy link
Copy Markdown
Contributor

destination-mssql Connector Test Results

113 tests   105 ✅  6m 27s ⏱️
 12 suites    8 💤
 12 files      0 ❌

Results for commit 9091e1e.

♻️ This comment has been updated with latest results.

@johnny-schmidt
Johnny Schmidt (johnny-schmidt) force-pushed the jschmidt/load-cdk/pre-speed-cleanup-5-remove-old-interface-code branch from 9d719e1 to 2db5580 Compare May 8, 2025 23:40
@johnny-schmidt
Johnny Schmidt (johnny-schmidt) changed the base branch from jschmidt/load-cdk/pre-speed-cleanup-4-old-file-uses-pipeline to jschmidt/load-cdk/pre-speed-cleanup-4b-azure-uses-new-old-file-xfer May 8, 2025 23:40
@johnny-schmidt
Johnny Schmidt (johnny-schmidt) force-pushed the jschmidt/load-cdk/pre-speed-cleanup-5-remove-old-interface-code branch from 2db5580 to 06b6538 Compare May 8, 2025 23:42
@johnny-schmidt
Johnny Schmidt (johnny-schmidt) force-pushed the jschmidt/load-cdk/pre-speed-cleanup-4b-azure-uses-new-old-file-xfer branch from 649624a to a9a7f57 Compare May 8, 2025 23:43

@edgao Edward Gao (edgao) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

couple nits, otherwise :shipit:

import io.airbyte.cdk.load.command.DestinationStream
import io.airbyte.cdk.load.state.CheckpointId

// DEPRECATED: Legacy file transfer

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

checking: we'd like to @Deprecated these, but we have werror enabled, and it would be really annoying to add an @Suppress("deprecation") to all the affected code?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is just a way to find all the stuff easily

suspend fun addStreamCheckpoint(
key: DestinationStream.Descriptor,
indexOrId: Long,
checkpointId: CheckpointId,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CheckpointId currently holds an Int rather than a Long - is that fine? (I'm assuming this only really matters for usecases still using the old checkpoint style, and running syncs with >2billion records?)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, I guess in theory this could break with really big syncs that send >= 1 state message per record.

private val failSyncIsEnqueued = AtomicBoolean(false)

private val closeStreamHasRun = ConcurrentHashMap<DestinationStream.Descriptor, AtomicBoolean>()
val closeStreamHasRun = ConcurrentHashMap<DestinationStream.Descriptor, AtomicBoolean>()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I think this can still be private?

launch(flushTickTask)
}
log.info { "Setting up load pipeline" }
loadPipeline!!.start { launch(it) }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit could probably do something like this, to avoid the !!

class DTL(loadPipeline: LoadPipeline?) {
  private val loadPipeline: LoadPipeline
  init { loadPipeline = loadPipeline ?: throw }
}

value = ["NP_NONNULL_PARAM_VIOLATION", "NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE"],
justification = "Kotlin async continuation"
)
class ObjectStorageStreamLoader<T : RemoteObject<*>, U : OutputStream>(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I was happy to see this guy go.

@johnny-schmidt
Johnny Schmidt (johnny-schmidt) force-pushed the jschmidt/load-cdk/pre-speed-cleanup-4b-azure-uses-new-old-file-xfer branch 2 times, most recently from f8c8bd1 to 24f6c4e Compare May 12, 2025 17:12
@johnny-schmidt
Johnny Schmidt (johnny-schmidt) force-pushed the jschmidt/load-cdk/pre-speed-cleanup-5-remove-old-interface-code branch from 06b6538 to c22d02e Compare May 12, 2025 17:16
@github-actions

github-actions Bot commented May 12, 2025 •

Copy link
Copy Markdown
Contributor

destination-azure-blob-storage Connector Test Results

119 tests   99 ✅  11m 9s ⏱️
  7 suites  20 💤
  7 files     0 ❌

Results for commit 9091e1e.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented May 12, 2025 •

Copy link
Copy Markdown
Contributor

destination-s3 Connector Test Results

360 tests   216 ✅  37m 53s ⏱️
 17 suites  144 💤
 17 files      0 ❌

Results for commit 9091e1e.

♻️ This comment has been updated with latest results.

Base automatically changed from jschmidt/load-cdk/pre-speed-cleanup-4b-azure-uses-new-old-file-xfer to master May 12, 2025 17:53
@johnny-schmidt
Johnny Schmidt (johnny-schmidt) force-pushed the jschmidt/load-cdk/pre-speed-cleanup-5-remove-old-interface-code branch 2 times, most recently from c11e00c to 4757809 Compare May 12, 2025 18:00
@johnny-schmidt
Johnny Schmidt (johnny-schmidt) force-pushed the jschmidt/load-cdk/pre-speed-cleanup-5-remove-old-interface-code branch from 4757809 to 9091e1e Compare May 12, 2025 18:16
@johnny-schmidt
Johnny Schmidt (johnny-schmidt) deleted the jschmidt/load-cdk/pre-speed-cleanup-5-remove-old-interface-code branch May 12, 2025 18:44

This branch was successfully deployed

1 active deployment
Preview — 9091e1e7 Deployed May 12, 2025 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants