Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix](bdb) Write OP_TIMESTAMP operation until it successed #33967

Merged
merged 1 commit into from
Apr 24, 2024

Conversation

w41ter
Copy link
Contributor

@w41ter w41ter commented Apr 22, 2024

Proposed changes

Issue Number: close #xxx

For now, it will reset the next journal id and return if the OP_TIMESTAMP operation writes failed. Because BDBJE will replicate the committed txns (only persisted in BDB log, but not replicated to other members) to FOLLOWERs after the connection resumed, directly resetting the next journal ID and returning will cause subsequent txn written to the same journal ID not to be replayed by the FOLLOWERS.

So for OP_TIMESTAMP operation, instead of returning early, try to write until it succeeds.

Further comments

If this is a relatively large or complex change, kick off the discussion at [email protected] by explaining why you chose the solution you did and what alternatives you considered, etc...

@doris-robot
Copy link

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR

Since 2024-03-18, the Document has been moved to doris-website.
See Doris Document.

@w41ter
Copy link
Contributor Author

w41ter commented Apr 22, 2024

run buildall

Copy link
Contributor

@SWJTU-ZhangLei SWJTU-ZhangLei left a comment

Choose a reason for hiding this comment

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

If write occure InsufficientExeption or RollbackException , Is unlimted loop suitable?

@w41ter
Copy link
Contributor Author

w41ter commented Apr 22, 2024

If write occure InsufficientExeption or RollbackException , Is unlimted loop suitable?

It will exit by transferring to a follower.

For now, it will reset the next journal id and return if the OP_TIMESTAMP
operation writes failed. Because BDBJE will replicate the committed txns (only
persisted in BDB log, but not replicated to other members) to FOLLOWERs after
the connection resumed, directly resetting the next journal id and returning
will cause subsequent txn written to the same journal ID not to be replayed by
the FOLLOWERS. So for OP_TIMESTAMP operation, try to write until it succeeds.
@w41ter
Copy link
Contributor Author

w41ter commented Apr 22, 2024

run buildall

@doris-robot
Copy link

TPC-H: Total hot run time: 38640 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit 9de46cd1a17d8581c9f1c4855d74e4b13914621c, data reload: false

------ Round 1 ----------------------------------
q1	17604	4380	4286	4286
q2	2015	196	184	184
q3	10455	1212	1192	1192
q4	10192	768	732	732
q5	7571	2705	2654	2654
q6	216	132	133	132
q7	1026	605	581	581
q8	9215	2093	2044	2044
q9	7502	6594	6526	6526
q10	8583	3521	3518	3518
q11	450	240	226	226
q12	540	223	216	216
q13	17765	2956	2920	2920
q14	274	219	233	219
q15	514	488	495	488
q16	500	398	384	384
q17	980	747	740	740
q18	7380	6932	6679	6679
q19	7789	1559	1508	1508
q20	649	300	299	299
q21	3501	2810	2931	2810
q22	363	312	302	302
Total cold run time: 115084 ms
Total hot run time: 38640 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4315	4207	4186	4186
q2	368	273	252	252
q3	3043	2785	2763	2763
q4	1855	1644	1550	1550
q5	5297	5297	5294	5294
q6	207	121	121	121
q7	2269	1855	1873	1855
q8	3195	3345	3390	3345
q9	8595	8572	8792	8572
q10	4077	3947	4029	3947
q11	605	496	491	491
q12	818	635	644	635
q13	16952	3214	3175	3175
q14	347	285	281	281
q15	529	500	496	496
q16	492	442	445	442
q17	1833	1503	1506	1503
q18	8046	8024	7704	7704
q19	1670	1510	1562	1510
q20	2036	1827	1864	1827
q21	6975	4895	4909	4895
q22	558	487	485	485
Total cold run time: 74082 ms
Total hot run time: 55329 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 185714 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
TPC-DS sf100 test result on commit 9de46cd1a17d8581c9f1c4855d74e4b13914621c, data reload: false

query1	899	391	377	377
query2	6526	2556	2429	2429
query3	6662	210	209	209
query4	24849	21312	21319	21312
query5	4128	434	406	406
query6	280	180	183	180
query7	4595	282	286	282
query8	243	191	188	188
query9	8503	2270	2264	2264
query10	411	245	253	245
query11	14707	14259	14160	14160
query12	133	89	86	86
query13	1654	366	391	366
query14	9644	7536	7502	7502
query15	271	186	181	181
query16	8151	260	269	260
query17	1917	548	539	539
query18	2114	273	270	270
query19	265	151	150	150
query20	88	87	90	87
query21	206	130	131	130
query22	4981	4800	4779	4779
query23	33833	33230	33457	33230
query24	10696	3109	3019	3019
query25	610	379	382	379
query26	715	159	153	153
query27	2328	373	376	373
query28	5969	2065	2060	2060
query29	879	612	600	600
query30	290	180	188	180
query31	1034	752	748	748
query32	95	51	52	51
query33	662	245	248	245
query34	925	481	494	481
query35	845	712	716	712
query36	1109	950	922	922
query37	116	70	76	70
query38	3419	3350	3303	3303
query39	1768	1594	1580	1580
query40	182	130	128	128
query41	47	45	46	45
query42	104	97	100	97
query43	605	549	560	549
query44	1154	735	750	735
query45	293	287	252	252
query46	1122	769	774	769
query47	2024	1924	1986	1924
query48	381	300	294	294
query49	873	394	401	394
query50	774	402	391	391
query51	6825	6821	6807	6807
query52	97	94	85	85
query53	339	276	279	276
query54	303	226	238	226
query55	83	76	75	75
query56	240	234	225	225
query57	1225	1094	1121	1094
query58	220	191	211	191
query59	3468	3271	3096	3096
query60	260	231	228	228
query61	88	89	105	89
query62	590	429	448	429
query63	300	278	281	278
query64	4978	3991	3994	3991
query65	3072	3032	3016	3016
query66	748	327	331	327
query67	15399	14862	14896	14862
query68	5179	542	527	527
query69	476	303	301	301
query70	1269	1202	1225	1202
query71	1411	1273	1274	1273
query72	6474	2755	2570	2570
query73	716	322	322	322
query74	6971	6451	6548	6451
query75	3405	2656	2615	2615
query76	3298	1005	921	921
query77	400	272	268	268
query78	10920	10179	10157	10157
query79	9150	515	524	515
query80	2267	471	454	454
query81	531	243	248	243
query82	1237	96	94	94
query83	269	169	174	169
query84	276	88	87	87
query85	1886	325	322	322
query86	482	300	292	292
query87	3548	3358	3249	3249
query88	5146	2407	2418	2407
query89	566	376	371	371
query90	1956	181	180	180
query91	127	94	96	94
query92	56	45	45	45
query93	6570	504	489	489
query94	1094	181	180	180
query95	390	300	302	300
query96	595	258	259	258
query97	3090	2926	2928	2926
query98	234	220	217	217
query99	1239	856	834	834
Total cold run time: 293542 ms
Total hot run time: 185714 ms

@doris-robot
Copy link

ClickBench: Total hot run time: 29.64 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit 9de46cd1a17d8581c9f1c4855d74e4b13914621c, data reload: false

query1	0.04	0.03	0.03
query2	0.09	0.03	0.04
query3	0.23	0.04	0.04
query4	1.66	0.07	0.07
query5	0.48	0.49	0.52
query6	1.42	0.71	0.72
query7	0.03	0.01	0.01
query8	0.05	0.04	0.04
query9	0.56	0.50	0.49
query10	0.55	0.56	0.55
query11	0.16	0.11	0.11
query12	0.14	0.12	0.12
query13	0.60	0.58	0.59
query14	0.75	0.76	0.78
query15	0.82	0.81	0.80
query16	0.37	0.36	0.36
query17	1.03	0.92	1.01
query18	0.22	0.23	0.24
query19	1.82	1.67	1.80
query20	0.02	0.01	0.01
query21	15.40	0.68	0.65
query22	4.92	7.59	1.38
query23	18.21	1.29	1.31
query24	2.08	0.23	0.20
query25	0.16	0.09	0.08
query26	0.28	0.17	0.17
query27	0.09	0.08	0.08
query28	13.24	1.00	0.97
query29	12.63	3.29	3.21
query30	0.26	0.07	0.05
query31	2.84	0.39	0.38
query32	3.28	0.47	0.45
query33	2.81	2.83	2.81
query34	16.95	4.38	4.48
query35	4.49	4.48	4.47
query36	0.65	0.47	0.46
query37	0.17	0.15	0.16
query38	0.15	0.14	0.14
query39	0.05	0.03	0.03
query40	0.18	0.16	0.13
query41	0.11	0.06	0.05
query42	0.05	0.05	0.05
query43	0.03	0.04	0.04
Total cold run time: 110.07 s
Total hot run time: 29.64 s

Copy link
Contributor

PR approved by anyone and no changes requested.

Copy link
Contributor

@dataroaring dataroaring left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

PR approved by at least one committer and no changes requested.

@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Apr 24, 2024
@dataroaring dataroaring merged commit 1330dfc into apache:master Apr 24, 2024
26 of 28 checks passed
@w41ter w41ter deleted the fix_op_timestamp branch April 24, 2024 06:59
w41ter added a commit to w41ter/incubator-doris that referenced this pull request Apr 24, 2024
)

For now, it will reset the next journal id and return if the OP_TIMESTAMP
operation writes failed. Because BDBJE will replicate the committed txns (only
persisted in BDB log, but not replicated to other members) to FOLLOWERs after
the connection resumed, directly resetting the next journal id and returning
will cause subsequent txn written to the same journal ID not to be replayed by
the FOLLOWERS. So for OP_TIMESTAMP operation, try to write until it succeeds.
yiguolei pushed a commit that referenced this pull request Apr 24, 2024
For now, it will reset the next journal id and return if the OP_TIMESTAMP
operation writes failed. Because BDBJE will replicate the committed txns (only
persisted in BDB log, but not replicated to other members) to FOLLOWERs after
the connection resumed, directly resetting the next journal id and returning
will cause subsequent txn written to the same journal ID not to be replayed by
the FOLLOWERS. So for OP_TIMESTAMP operation, try to write until it succeeds.
yiguolei pushed a commit that referenced this pull request Apr 24, 2024
For now, it will reset the next journal id and return if the OP_TIMESTAMP
operation writes failed. Because BDBJE will replicate the committed txns (only
persisted in BDB log, but not replicated to other members) to FOLLOWERs after
the connection resumed, directly resetting the next journal id and returning
will cause subsequent txn written to the same journal ID not to be replayed by
the FOLLOWERS. So for OP_TIMESTAMP operation, try to write until it succeeds.
yiguolei pushed a commit that referenced this pull request Apr 25, 2024
For now, it will reset the next journal id and return if the OP_TIMESTAMP
operation writes failed. Because BDBJE will replicate the committed txns (only
persisted in BDB log, but not replicated to other members) to FOLLOWERs after
the connection resumed, directly resetting the next journal id and returning
will cause subsequent txn written to the same journal ID not to be replayed by
the FOLLOWERS. So for OP_TIMESTAMP operation, try to write until it succeeds.
dataroaring pushed a commit that referenced this pull request Apr 25, 2024
…34061)

For now, it will reset the next journal id and return if the OP_TIMESTAMP
operation writes failed. Because BDBJE will replicate the committed txns (only
persisted in BDB log, but not replicated to other members) to FOLLOWERs after
the connection resumed, directly resetting the next journal id and returning
will cause subsequent txn written to the same journal ID not to be replayed by
the FOLLOWERS. So for OP_TIMESTAMP operation, try to write until it succeeds.
mongo360 pushed a commit to mongo360/doris that referenced this pull request Aug 16, 2024
) (apache#34061)

For now, it will reset the next journal id and return if the OP_TIMESTAMP
operation writes failed. Because BDBJE will replicate the committed txns (only
persisted in BDB log, but not replicated to other members) to FOLLOWERs after
the connection resumed, directly resetting the next journal id and returning
will cause subsequent txn written to the same journal ID not to be replayed by
the FOLLOWERS. So for OP_TIMESTAMP operation, try to write until it succeeds.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by one committer. dev/2.0.10-merged p0_b reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants