legend-engine icon indicating copy to clipboard operation
legend-engine copied to clipboard

Add isolation level support to relational block

Open Yasirmod17 opened this issue 1 year ago • 4 comments

Add Isolation Level Support to Relational Block in Legend Engine

This PR adds support for transaction isolation levels in relational blocks by:

  1. Creating a new enum TransactionIsolationLevel that maps to the standard JDBC isolation levels
  2. Adding an isolationLevel property to RelationalBlockExecutionNode
  3. Updating RelationalExecutionNodeExecutor to set the isolation level on connections
  4. Adding a method to BlockConnectionContext to set the isolation level on all connections

The isolation levels supported are:

  • NONE (Connection.TRANSACTION_NONE)
  • READ_UNCOMMITTED (Connection.TRANSACTION_READ_UNCOMMITTED)
  • READ_COMMITTED (Connection.TRANSACTION_READ_COMMITTED)
  • REPEATABLE_READ (Connection.TRANSACTION_REPEATABLE_READ)
  • SERIALIZABLE (Connection.TRANSACTION_SERIALIZABLE)

Pure Metamodel Changes

In addition to the Java implementation, this PR also adds isolation level support to the Pure metamodel in the vX_X_X protocol version:

  1. Created a new TransactionIsolationLevel enum in the Pure metamodel
  2. Added an isolationLevel property to the RelationalBlockExecutionNode class in the Pure metamodel
  3. Updated the transformation function to handle the new property

These changes ensure that isolation levels can be properly represented in the Pure model and correctly transformed to the protocol model.

This implementation ensures backward compatibility by making the isolation level property optional. Existing code that doesn't specify an isolation level will continue to work with the default isolation level of the database.

Link to Devin run

https://app.devin.ai/sessions/e79a769f53b54ed8976bc6696ceb2638

Requested by

[email protected]

Yasirmod17 avatar Mar 11 '25 16:03 Yasirmod17

CLA Not Signed

Workflow Telemetry - Build CI / Build

Workflow telemetry for commit 1624291d84eb29707c672626486b0f9c7f5e1738 You can access workflow job details here

Step Trace

gantt
	title Build
	dateFormat x
	axisFormat %H:%M:%S
	Set up job : milestone, 1741709482000, 1741709484000
	Checkout repo : 1741709484000, 1741709488000
	Cache Maven dependencies : 1741709488000, 1741709512000
	Set up JDK : 1741709512000, 1741709527000
	Check Java version : 1741709527000, 1741709527000
	Configure git : 1741709527000, 1741709527000
	Download deps and plugins : 1741709527000, 1741709549000
	Collect Workflow Telemetry : 1741709549000, 1741709550000
	Build (PR) : 1741709550000, 1741710439000
	Build (with Maven Deploy + Docker Snapshot) : done, 1741710439000, 1741710439000
	Test : done, 1741710439000, 1741710439000
	Test SDT Postgres : done, 1741710439000, 1741710439000
	Test SDT DuckDB : done, 1741710439000, 1741710439000
	Generate PCT Report : done, 1741710439000, 1741710439000
	Upload PCT HTML Report : done, 1741710439000, 1741710439000

CPU Metrics

chart_stacked_area_time_ce58f558-e70b-4142-896e-a8eb1b3f2fe6

Memory Metrics

chart_stacked_area_time_811f6220-a0ad-4818-88f8-9a682f26f175

IO Metrics

Read Write
Network I/O chart_line_time_e14c5310-056f-42c5-9ddc-099e7cb6aa19 chart_line_time_9bab9873-3d9a-4b8a-869c-7af2aa732232
Disk I/O chart_line_time_6b310200-d939-48e7-837a-ca9debac112e chart_line_time_ee3f64f6-0d99-4618-818a-ab4c9641dd4c

github-actions[bot] avatar Mar 11 '25 16:03 github-actions[bot]

Workflow Telemetry - Build CI / Build

Workflow telemetry for commit 9c677ff8736d94ea3860cc046295b13b0ce3d6b6 You can access workflow job details here

Step Trace

gantt
	title Build
	dateFormat x
	axisFormat %H:%M:%S
	Set up job : milestone, 1741710452000, 1741710454000
	Checkout repo : 1741710454000, 1741710458000
	Cache Maven dependencies : 1741710458000, 1741710480000
	Set up JDK : 1741710480000, 1741710497000
	Check Java version : 1741710497000, 1741710498000
	Configure git : 1741710498000, 1741710498000
	Download deps and plugins : 1741710498000, 1741710522000
	Collect Workflow Telemetry : 1741710522000, 1741710522000
	Build (PR) : crit, 1741710522000, 1741711584000
	Build (with Maven Deploy + Docker Snapshot) : done, 1741711584000, 1741711584000
	Test : done, 1741711584000, 1741711584000
	Test SDT Postgres : done, 1741711584000, 1741711584000
	Test SDT DuckDB : done, 1741711584000, 1741711584000
	Generate PCT Report : done, 1741711584000, 1741711584000
	Upload PCT HTML Report : done, 1741711584000, 1741711584000

CPU Metrics

chart_stacked_area_time_c5d4523e-16f6-4e57-8330-9d78e6cc7ee4

Memory Metrics

chart_stacked_area_time_7ae34a57-e07c-461d-87d5-bcd46d353ce1

IO Metrics

Read Write
Network I/O chart_line_time_723e5440-50d5-4953-bcf7-523a4fd8bd04 chart_line_time_7b091824-12ed-4c6b-a887-2c7890718513
Disk I/O chart_line_time_465e0408-cba7-4154-b493-a945333d6486 chart_line_time_a8810141-29bb-47df-8aa5-908c2d5e0d6d

github-actions[bot] avatar Mar 11 '25 16:03 github-actions[bot]

Test Results

0 files   -     2  0 suites   - 2   0s :stopwatch: -22s 0 tests  - 122  0 :heavy_check_mark:  - 122  0 :zzz: ±0  0 :x: ±0  0 runs   - 244  0 :heavy_check_mark:  - 244  0 :zzz: ±0  0 :x: ±0 

Results for commit 9c677ff8. ± Comparison against base commit 3a9fdf2b.

This pull request removes 122 tests.
org.finos.legend.engine.relational.test.sdt.SdtTestSuiteBuilder$SDTTestCase ‑ FuncTests - abs(0/3)
org.finos.legend.engine.relational.test.sdt.SdtTestSuiteBuilder$SDTTestCase ‑ FuncTests - abs(1/3)
org.finos.legend.engine.relational.test.sdt.SdtTestSuiteBuilder$SDTTestCase ‑ FuncTests - abs(2/3)
org.finos.legend.engine.relational.test.sdt.SdtTestSuiteBuilder$SDTTestCase ‑ FuncTests - abs(3/3)
org.finos.legend.engine.relational.test.sdt.SdtTestSuiteBuilder$SDTTestCase ‑ FuncTests - acos(0/3)
org.finos.legend.engine.relational.test.sdt.SdtTestSuiteBuilder$SDTTestCase ‑ FuncTests - acos(1/3)
org.finos.legend.engine.relational.test.sdt.SdtTestSuiteBuilder$SDTTestCase ‑ FuncTests - acos(2/3)
org.finos.legend.engine.relational.test.sdt.SdtTestSuiteBuilder$SDTTestCase ‑ FuncTests - acos(3/3)
org.finos.legend.engine.relational.test.sdt.SdtTestSuiteBuilder$SDTTestCase ‑ FuncTests - ascii(0/4)
org.finos.legend.engine.relational.test.sdt.SdtTestSuiteBuilder$SDTTestCase ‑ FuncTests - ascii(1/4)
…

github-actions[bot] avatar Mar 11 '25 16:03 github-actions[bot]

This PR is stale because it has been open for 30 days with no activity. Please remove stale label or add any comment to keep this open. Otherwise this will be closed in 5 days.

finos-admin avatar May 20 '25 12:05 finos-admin

This PR was closed because it has been inactive for 35 days. Please re-open if this PR is still relevant.

finos-admin avatar May 26 '25 12:05 finos-admin