PostgreSQL的学习心得和知识总结(一百五十二)|transaction_timeout:达到事务超时时终止会话

news2024/9/30 14:25:16

注:提前言明 本文借鉴了以下博主、书籍或网站的内容,其列表如下:

1、参考书籍:《PostgreSQL数据库内核分析》
2、参考书籍:《数据库事务处理的艺术:事务管理与并发控制》
3、PostgreSQL数据库仓库链接,点击前往
4、日本著名PostgreSQL数据库专家 铃木启修 网站主页,点击前往
5、参考书籍:《PostgreSQL中文手册》
6、参考书籍:《PostgreSQL指南:内幕探索》,点击前往
7、参考书籍:《事务处理 概念与技术》
8、on-rocks-and-sand,点击前往


1、本文内容全部来源于开源社区 GitHub和以上博主的贡献,本文也免费开源(可能会存在问题,评论区等待大佬们的指正)
2、本文目的:开源共享 抛砖引玉 一起学习
3、本文不提供任何资源 不存在任何交易 与任何组织和机构无关
4、大家可以根据需要自行 复制粘贴以及作为其他个人用途,但是不允许转载 不允许商用 (写作不易,还请见谅 💖)
5、本文内容基于PostgreSQL master源码开发而成


transaction_timeout:达到事务超时时终止会话

  • 文章快速说明索引
  • 功能实现背景说明
  • 功能实现源码解析
    • 与 idle_in_transaction_session_timeout
    • 与 statement_timeout
    • transaction_timeout
  • 调试过程信号处理
  • 遗留问题汇总分析



文章快速说明索引

学习目标:

做数据库内核开发久了就会有一种 少年得志,年少轻狂 的错觉,然鹅细细一品觉得自己其实不算特别优秀 远远没有达到自己想要的。也许光鲜的表面掩盖了空洞的内在,每每想到于此,皆有夜半临渊如履薄冰之感。为了睡上几个踏实觉,即日起 暂缓其他基于PostgreSQL数据库的兼容功能开发,近段时间 将着重于学习分享Postgres的基础知识和实践内幕。


学习内容:(详见目录)

1、transaction_timeout:达到事务超时时终止会话


学习时间:

2024年09月27日 17:57:04


学习产出:

1、PostgreSQL数据库基础知识回顾 1个
2、CSDN 技术博客 1篇
3、PostgreSQL数据库内核深入学习


注:下面我们所有的学习环境是Centos8+PostgreSQL master +Oracle19C+MySQL8.0

postgres=# select version();
                                                  version                                                   
------------------------------------------------------------------------------------------------------------
 PostgreSQL 18devel on x86_64-pc-linux-gnu, compiled by gcc (GCC) 8.5.0 20210514 (Red Hat 8.5.0-21), 64-bit
(1 row)

postgres=#

#-----------------------------------------------------------------------------#

SQL> select * from v$version;          

BANNER        Oracle Database 19c EE Extreme Perf Release 19.0.0.0.0 - Production	
BANNER_FULL	  Oracle Database 19c EE Extreme Perf Release 19.0.0.0.0 - Production Version 19.17.0.0.0	
BANNER_LEGACY Oracle Database 19c EE Extreme Perf Release 19.0.0.0.0 - Production	
CON_ID 0


#-----------------------------------------------------------------------------#

mysql> select version();
+-----------+
| version() |
+-----------+
| 8.0.27    |
+-----------+
1 row in set (0.06 sec)

mysql>

功能实现背景说明

我们已经有两个参数来控制长事务:statement_timeoutidle_in_transaction_session_timeout。但是,如果事务执行的命令足够短且不超过 statement_timeout,并且命令之间的暂停时间适合 idle_in_transaction_session_timeout,则事务可以无限期持续。

在这种情况下,transaction_timeout 可确保事务的持续时间不超过指定的超时时间。如果超过,事务和执行该事务的会话将被终止。如下:

postgres=# select version();
                                                  version                                                   
------------------------------------------------------------------------------------------------------------
 PostgreSQL 18devel on x86_64-pc-linux-gnu, compiled by gcc (GCC) 8.5.0 20210514 (Red Hat 8.5.0-21), 64-bit
(1 row)

postgres=# show statement_timeout ;
 statement_timeout 
-------------------
 0
(1 row)

postgres=# show transaction_timeout ;
 transaction_timeout 
---------------------
 0
(1 row)

postgres=# set transaction_timeout = '10s';
SET
postgres=# begin ;
BEGIN
postgres=*# select pg_sleep(2);
 pg_sleep 
----------
 
(1 row)

postgres=*# 2024-09-28 19:28:30.891 PDT [45558] FATAL:  terminating connection due to transaction timeout
postgres=*#

然后看一下进程相关,如下:

在这里插入图片描述

如上,45875的进程死了,会话已断开。然后随着我在psql上继续执行,又有了一个新的会话得以建立。这个问题我后面再详细解释(大家也可以看一下下图先思考思考):

在这里插入图片描述


我第一次看到这个的时候有点懵,原因如下:

在这里插入图片描述

我当时以为就像statement_timeout这样,事务超时也没必要直接断开连接 事务失败(rollback即可)。

然后带着这个疑惑,去看了一下邮件列表 如下:

  • Transaction timeout,点击前往

在这里插入图片描述

注1:有兴趣的小伙伴可以自行查看邮件列表
注2:接下来我们一起看一下transaction_timeout的内部实现,以及为什么不能像statement_timeout这样去实现


功能实现源码解析

首先看一下官方文档的解释,如下:

终止事务中持续时间超过指定时间的任何会话。此限制既适用于显式事务(以 BEGIN 启动),也适用于与单个语句相对应的隐式启动事务。
如果指定此值时没有单位,则以毫秒为单位。零值(默认值)将禁用超时。

如果 transaction_timeout 短于或等于 idle_in_transaction_session_timeout 或 statement_timeout,则忽略较长的超时。
不建议在 postgresql.conf 中设置 transaction_timeout,因为它会影响所有会话。

该GUC参数定义,如下:

// src/backend/utils/misc/guc_tables.c

	{
		{"transaction_timeout", PGC_USERSET, CLIENT_CONN_STATEMENT,
			gettext_noop("Sets the maximum allowed duration of any transaction within a session (not a prepared transaction)."),
			gettext_noop("A value of 0 turns off the timeout."),
			GUC_UNIT_MS
		},
		&TransactionTimeout,
		0, 0, INT_MAX,
		NULL, assign_transaction_timeout, NULL
	},

与 idle_in_transaction_session_timeout

// src/backend/tcop/postgres.c

		...
		/*
		 * (1) If we've reached idle state, tell the frontend we're ready for
		 * a new query.
		 *
		 * Note: this includes fflush()'ing the last of the prior output.
		 *
		 * This is also a good time to flush out collected statistics to the
		 * cumulative stats system, and to update the PS stats display.  We
		 * avoid doing those every time through the message loop because it'd
		 * slow down processing of batched messages, and because we don't want
		 * to report uncommitted updates (that confuses autovacuum).  The
		 * notification processor wants a call too, if we are not in a
		 * transaction block.
		 *
		 * Also, if an idle timeout is enabled, start the timer for that.
		 */
		if (send_ready_for_query)
		{
			if (IsAbortedTransactionBlockState())
			{
				set_ps_display("idle in transaction (aborted)");
				pgstat_report_activity(STATE_IDLEINTRANSACTION_ABORTED, NULL);

				/* Start the idle-in-transaction timer */
				if (IdleInTransactionSessionTimeout > 0
					&& (IdleInTransactionSessionTimeout < TransactionTimeout || TransactionTimeout == 0))
				{
					idle_in_transaction_timeout_enabled = true;
					enable_timeout_after(IDLE_IN_TRANSACTION_SESSION_TIMEOUT,
										 IdleInTransactionSessionTimeout);
				}
			}
			else if (IsTransactionOrTransactionBlock())
			{
				set_ps_display("idle in transaction");
				pgstat_report_activity(STATE_IDLEINTRANSACTION, NULL);

				/* Start the idle-in-transaction timer */
				if (IdleInTransactionSessionTimeout > 0
					&& (IdleInTransactionSessionTimeout < TransactionTimeout || TransactionTimeout == 0))
				{
					idle_in_transaction_timeout_enabled = true;
					enable_timeout_after(IDLE_IN_TRANSACTION_SESSION_TIMEOUT,
										 IdleInTransactionSessionTimeout);
				}
			}
			...

与 statement_timeout

/*
 * Start statement timeout timer, if enabled.
 *
 * If there's already a timeout running, don't restart the timer.  That
 * enables compromises between accuracy of timeouts and cost of starting a
 * timeout.
 */
static void
enable_statement_timeout(void)
{
	/* must be within an xact */
	Assert(xact_started);

	if (StatementTimeout > 0
		&& (StatementTimeout < TransactionTimeout || TransactionTimeout == 0))
	{
		if (!get_timeout_active(STATEMENT_TIMEOUT))
			enable_timeout_after(STATEMENT_TIMEOUT, StatementTimeout);
	}
	else
	{
		if (get_timeout_active(STATEMENT_TIMEOUT))
			disable_timeout(STATEMENT_TIMEOUT, false);
	}
}

如上,当transaction_timeout 小于或等于 idle_in_transaction_session_timeoutstatement_timeout,则忽略较长的超时。


transaction_timeout

// src/backend/utils/init/postinit.c

void
InitPostgres(const char *in_dbname, Oid dboid,
			 const char *username, Oid useroid,
			 bits32 flags,
			 char *out_dbname)
{
	...
	if (!bootstrap)
	{
		RegisterTimeout(DEADLOCK_TIMEOUT, CheckDeadLockAlert);
		RegisterTimeout(STATEMENT_TIMEOUT, StatementTimeoutHandler);
		RegisterTimeout(LOCK_TIMEOUT, LockTimeoutHandler);
		RegisterTimeout(IDLE_IN_TRANSACTION_SESSION_TIMEOUT,
						IdleInTransactionSessionTimeoutHandler);
		RegisterTimeout(TRANSACTION_TIMEOUT, TransactionTimeoutHandler); // here
		RegisterTimeout(IDLE_SESSION_TIMEOUT, IdleSessionTimeoutHandler);
		RegisterTimeout(CLIENT_CONNECTION_CHECK_TIMEOUT, ClientCheckTimeoutHandler);
		RegisterTimeout(IDLE_STATS_UPDATE_TIMEOUT,
						IdleStatsUpdateTimeoutHandler);
	}
	...
}

static void
TransactionTimeoutHandler(void)
{
	TransactionTimeoutPending = true;
	InterruptPending = true;
	SetLatch(MyLatch);
}

接下来,这里修改源码 使用ShowTransactionState函数进行打印,如下:

[postgres@localhost:~/test/bin]$ ./psql 
INFO:  CommitTransaction(1) name: unnamed; blockState: STARTED; state: INPROGRESS, xid/subid/cid: 0/1/0
psql (18devel)
Type "help" for help.

postgres=# set transaction_timeout = '10s';
INFO:  StartTransaction(1) name: unnamed; blockState: DEFAULT; state: INPROGRESS, xid/subid/cid: 0/1/0
INFO:  CommitTransaction(1) name: unnamed; blockState: STARTED; state: INPROGRESS, xid/subid/cid: 0/1/0
SET
postgres=# begin;
INFO:  StartTransaction(1) name: unnamed; blockState: DEFAULT; state: INPROGRESS, xid/subid/cid: 0/1/0
BEGIN
postgres=*# commit;
INFO:  CommitTransaction(1) name: unnamed; blockState: END; state: INPROGRESS, xid/subid/cid: 0/1/0
COMMIT
postgres=# begin;
INFO:  StartTransaction(1) name: unnamed; blockState: DEFAULT; state: INPROGRESS, xid/subid/cid: 0/1/0
BEGIN
postgres=*# select pg_sleep(20);
2024-09-28 20:42:58.376 PDT [62092] FATAL:  terminating connection due to transaction timeout
2024-09-28 20:42:58.376 PDT [62092] STATEMENT:  select pg_sleep(20);
FATAL:  terminating connection due to transaction timeout
server closed the connection unexpectedly1
        This probably means the server terminated abnormally
        before or while processing the request.
The connection to the server was lost. Attempting reset: INFO:  CommitTransaction(1) name: unnamed; blockState: STARTED; state: INPROGRESS, xid/subid/cid: 0/1/0
Succeeded.
postgres=#

若是有小伙伴对父子事务有限状态机感兴趣的,可以查看本人之前的博客,如下:

  • PostgreSQL的学习心得和知识总结(一百四十五)|深入理解PostgreSQL数据库之ShowTransactionState的使用及父子事务有限状态机,点击前往

transaction_timeout的超时启用/禁用,如下:

// src/backend/access/transam/xact.c

/*
 *	StartTransaction
 */
static void
StartTransaction(void)
{
	...
	/* Schedule transaction timeout */
	if (TransactionTimeout > 0)
		enable_timeout_after(TRANSACTION_TIMEOUT, TransactionTimeout);
	...
}
static void
CommitTransaction(void)
{
	...
	/* Disable transaction timeout */
	if (TransactionTimeout > 0)
		disable_timeout(TRANSACTION_TIMEOUT, false);
	...
}

static void
PrepareTransaction(void)
{
	...
	/* Disable transaction timeout */
	if (TransactionTimeout > 0)
		disable_timeout(TRANSACTION_TIMEOUT, false);
	...
}

static void
AbortTransaction(void)
{
	...
	/* Disable transaction timeout */
	if (TransactionTimeout > 0)
		disable_timeout(TRANSACTION_TIMEOUT, false);
	...
}

接下来我们调试一下transaction_timeout的相关内容,首先看一下enable_timeout_after的设置 如下:

在这里插入图片描述

注意这两个时间值,以及下面的核心设置:

在这里插入图片描述

其中第一个参数:ITIMER_REAL:以系统真实的时间来计算,它送出SIGALRM信号。若是对该函数感兴趣的小伙伴可以看一下这位老哥的博客,我们这里不再赘述:

  • linux c setitimer用法说明,点击前往

继续:

在这里插入图片描述

此时的函数堆栈,如下:

TransactionTimeoutHandler()
handle_sig_alarm(int postgres_signal_arg)
wrapper_handler(int postgres_signal_arg)
libpthread.so.0!<signal handler called> (未知源:0)
libc.so.6!epoll_wait (未知源:0)
WaitEventSetWaitBlock(WaitEventSet * set, int cur_timeout, WaitEvent * occurred_events, int nevents)
WaitEventSetWait(WaitEventSet * set, long timeout, WaitEvent * occurred_events, int nevents, uint32 wait_event_info)
secure_read(Port * port, void * ptr, size_t len)
pq_recvbuf()
pq_getbyte()
SocketBackend(StringInfo inBuf)
ReadCommand(StringInfo inBuf)
PostgresMain(const char * dbname, const char * username)
BackendMain(char * startup_data, size_t startup_data_len)
postmaster_child_launch(BackendType child_type, char * startup_data, size_t startup_data_len, ClientSocket * client_sock)
BackendStartup(ClientSocket * client_sock)
ServerLoop()
PostmasterMain(int argc, char ** argv)
main(int argc, char ** argv)

如上handle_sig_alarm的参数为 14,这就是上面信号SIGALRM

接下来的报错,如下:

在这里插入图片描述

因为这里报错级别是fatal error - abort process,进程退出,如下:

在这里插入图片描述

调试过程信号处理

因为上面的信号是SIGALRM,若是超时发送的是信号SIGINT 就例如StatementTimeoutHandler、LockTimeoutHandler等:

// src/backend/utils/init/postinit.c

/*
 * STATEMENT_TIMEOUT handler: trigger a query-cancel interrupt.
 */
static void
StatementTimeoutHandler(void)
{
	int			sig = SIGINT;

	/*
	 * During authentication the timeout is used to deal with
	 * authentication_timeout - we want to quit in response to such timeouts.
	 */
	if (ClientAuthInProgress)
		sig = SIGTERM;

#ifdef HAVE_SETSID
	/* try to signal whole process group */
	kill(-MyProcPid, sig);
#endif
	kill(MyProcPid, sig);
}

/*
 * LOCK_TIMEOUT handler: trigger a query-cancel interrupt.
 */
static void
LockTimeoutHandler(void)
{
#ifdef HAVE_SETSID
	/* try to signal whole process group */
	kill(-MyProcPid, SIGINT);
#endif
	kill(MyProcPid, SIGINT);
}

调试的时候就会被这些信号所打断,如下:

在这里插入图片描述

这些信号可以如下处理,就不再影响gdb调试,如下:

在这里插入图片描述

若是使用vscode调试,则可以如下设置:

在这里插入图片描述

注:关于调试过程中信号的处理和妙用 可以看一下建平的文档,如下:

  • https://blog.japinli.top/2022/11/postgresql-debug-checkpointer/

遗留问题汇总分析

有了上面的铺垫,我们先看一下第一个问题:为什么该GUC参数的实现不能像statement_timeout那样,如下:

postgres=# set statement_timeout = '30s';
SET
postgres=# select pg_sleep(40);
2024-09-28 22:11:51.127 PDT [67675] ERROR:  canceling statement due to statement timeout
2024-09-28 22:11:51.127 PDT [67675] STATEMENT:  select pg_sleep(40);
ERROR:  canceling statement due to statement timeout
postgres=# 
postgres=# reset statement_timeout;
RESET
postgres=# show statement_timeout;
 statement_timeout 
-------------------
 0
(1 row)

postgres=# select pg_sleep(40);
^C2024-09-28 22:12:11.129 PDT [67675] ERROR:  canceling statement due to user request
2024-09-28 22:12:11.129 PDT [67675] STATEMENT:  select pg_sleep(40);
Cancel request sent
ERROR:  canceling statement due to user request
postgres=#

statement_timeout超时,发送SIGINT 就像下面手动执行Ctrl + C。而transaction_timeout的如下:

postgres=# \d
        List of relations
 Schema | Name | Type  |  Owner   
--------+------+-------+----------
 public | t1   | table | postgres
(1 row)

postgres=# table t1;
 id 
----
(0 rows)

postgres=# set transaction_timeout = '30s';
SET
postgres=# begin ;
BEGIN
postgres=*# ^C
postgres=*# ^C
postgres=*# insert into t1 values (1);
INSERT 0 1
postgres=*# commit ;
COMMIT
postgres=# table t1 ;
 id 
----
  1
(1 row)

postgres=#

就像邮件列表里面的分析:secure_read() 里面处理不了 SIGINT 信号,通过发送 SIGINT 信号的方式没办法结束事务。之后原作者就将实现进行了更改,有兴趣的小伙伴可以自行查看patch v4以及之后的!


第二个问题:在与psql交互中 旧的会话因为事务超时而断开,然后怎么就又建立一个新的?如下:

在这里插入图片描述

如上psql进程还在,如下是restore逻辑:

// src/bin/psql/common.c

/* CheckConnection
 *
 * Verify that we still have a good connection to the backend, and if not,
 * see if it can be restored.
 *
 * Returns true if either the connection was still there, or it could be
 * restored successfully; false otherwise.  If, however, there was no
 * connection and the session is non-interactive, this will exit the program
 * with a code of EXIT_BADCONN.
 */
static bool
CheckConnection(void);

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/2179844.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

影刀---如何进行自动化操作

本文不是广告&#xff0c;没有人给我宣传费&#xff0c;只是单纯的觉得这个软件很好用 感谢大家的多多支持哦 本文 1.基本概念与操作&#xff08;非标准下拉框和上传下载&#xff09;非标准对话框的操作上传对话框、下载的对话框、提示的对话框 2.综合案例3.找不到元素怎么办&a…

从AR眼镜到智能巡检:XR技术的演变与未来潜力

XR&#xff0c;即扩展现实&#xff08;Extended Reality&#xff09;&#xff0c;是一个涵盖了增强现实&#xff08;AR&#xff09;、虚拟现实&#xff08;VR&#xff09;和混合现实&#xff08;MR&#xff09;的广泛概念。 从我们最初接触到的手机应用到Hololens&#xff0c;…

(作业)第三期书生·浦语大模型实战营(十一卷王场)--书生入门岛通关第1关Linux 基础知识

关卡任务 闯关任务需要在关键步骤中截图&#xff1a; 任务描述 完成所需时间 闯关任务 完成SSH连接与端口映射并运行hello_world.py 10min 可选任务 1 将Linux基础命令在开发机上完成一遍 10min 可选任务 2 使用 VSCODE 远程连接开发机并创建一个conda环境 10min 可选任务 3 创…

图片体积在线压缩神器 可自由设置图片的压缩大小 带完整的安装代码包以及搭建部署教程

系统概述 随着互联网的快速发展&#xff0c;图片作为网页内容的重要组成部分&#xff0c;其优化需求日益迫切。传统的图片压缩方法往往需要在牺牲一定质量的前提下减小体积&#xff0c;而“图片体积在线压缩神器”则致力于在保持图片质量的同时&#xff0c;实现体积的最小化。…

Arthas perfcounter(查看当前 JVM 的 Perf Counter 信息)

文章目录 二、命令列表2.1 jvm相关命令2.1.13 perfcounter&#xff08;查看当前 JVM 的 Perf Counter 信息&#xff09;举例1&#xff1a;查看当前 JVM 的 Perf Counter 信息举例2&#xff1a;可以用-d参数打印更多信息 本人其他相关文章链接 二、命令列表 2.1 jvm相关命令 2…

SpringCloud-pom创建Eureka

<?xml version"1.0" encoding"UTF-8"?> <project xmlns"http://maven.apache.org/POM/4.0.0" xmlns:xsi"http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation"http://maven.apache.org/POM/4.0.0 https://…

通过Ideal和gitbash共同实现分支合并

文章目录 背景描述&#xff1a;演示jy_20240704_develop分支同步到jy_dev分支方式一方式二 背景描述&#xff1a; 目前项目里有四个分支&#xff0c;分别是master、jy_20240704_develop、jy_dev、jy_qas。 其中master是主分支&#xff0c;其他三个分支都是根据master来创建的…

海陆钻井自动化作业机器人比例阀放大器

海陆钻井自动化作业机器人是现代海洋石油勘探与钻井领域的关键装备&#xff0c;它通过自动化和无人化技术显著提高了钻井效率和安全性。海陆钻井自动化作业机器人主要用于在海上和陆地的钻井平台上进行自动化、无人化的一体化作业。这种设备能够自动切换钻杆&#xff0c;极大地…

解决Ubuntu无法找到python3.7的包的问题 E: Couldn‘t find any package by glob ‘python3.7‘

该问题可能是由于默认的 Ubuntu 存储库中没有 Python 3.7 相关的包或系统配置的问题。可以尝试以下方法解决问题&#xff1a; 1. 使用 deadsnakes PPA 添加 Python 3.7 支持 deadsnakes PPA 是一个第三方存储库&#xff0c;提供多版本的 Python 支持&#xff0c;包括 Python …

外卖点餐小程序源码系统 单店多门店自助切换 带完整的安装代码包以及搭建部署教程

系统概述 本外卖点餐小程序源码系统旨在帮助餐饮企业和商家快速搭建一个功能完善的在线外卖平台。系统支持单店与多门店的灵活切换&#xff0c;方便商家根据自身业务需求进行管理和运营。同时&#xff0c;系统还提供了丰富的营销工具和数据分析功能&#xff0c;助力商家实现精…

管理层“建行化”弊端显现?增收不增利,海外业务亦“不争气”

撰稿|芋圆 曾经&#xff0c;上海银行&#xff08;SH:601229&#xff09;在城商行中无论是规模还是盈利均排在前位&#xff0c;仅次于北京银行&#xff08;SH:601169&#xff09;。而近些年&#xff0c;该行的增长态势大不如前&#xff0c;在城商行中的排位持续下滑&#xff0c…

unity3D雨雪等粒子特效不穿透房屋效果实现(粒子不穿透模型)

做项目有时候会做天气模拟,模拟雨雪天气等等。但是容易忽略一个问题,就是房屋内不应该下雨或者下雪,这样不就穿帮了嘛。 下面就粒子穿透物体问题做一个demo。 正常下雨下雪在室内的话,你可以看到,粒子是穿透建筑的。 那要怎么模拟真实的雨雪天气,不让粒子穿透房屋建筑呢…

pdf文档翻译成英文很简单?搞定复杂的外语文献文档就靠它

转眼间又是一年国庆&#xff0c;怎么样&#xff0c;大一新生们适应得还好吗&#xff1f; 没事&#xff0c;刚到陌生的校园环境中&#xff0c;分分钟都在想家&#xff0c;还没适应集体宿舍生活很正常的...... 什么&#xff1f;已经有同学在着手准备写论文了&#xff1f;而且需要…

诗画紫砂壶

大家详细解答一首网络上流传的顺口溜&#xff0c;其中包含了很多的紫砂壶型。 // 紫砂壶型 // 秦权汉瓦唐羽仙&#xff0c;西施文旦美人肩。 逸公德钟对却月&#xff0c;仿鼓虚扁望方山。东坡提梁卧井栏&#xff0c;供春提璧看柿圆。荷花海棠吹松段。掇只君乐奏合欢&#xff…

【高中数学/对数/指数】已知函数f(x)=e^x-ln(x+m),求证m<=2时,证明f(x)>0

【问题】 已知函数f(x)e^x-ln(xm),求证m<2时&#xff0c;证明f(x)>0 &#xff08;2013年高考全国卷II理科第21题&#xff09; 【出处】 《高中数学解题思维策略》P30 例2-11 杨林军编著 【解答】 对于ye^x,总有e^x>x1 (x0时去等) 对于yln(xm),总有yxm-1>ln(…

Hbase要点简记

Hbase要点简记 Hbase1、底层架构2、表逻辑结构 Hbase HBase是一个分布式的、列式的、实时查询的、非关系型数据库&#xff0c;可以处理PB级别的数据&#xff0c;吞吐量可以到的百万查询/每秒。主要应用于接口等实时数据应用需求&#xff0c;针对具体需求&#xff0c;设计高效率…

A Learning-Based Approach to Static Program Slicing —— 论文笔记

A Learning-Based Approach to Static Program Slicing OOPLSA’2024 文章目录 A Learning-Based Approach to Static Program Slicing1. Abstract2. Motivation(1) 为什么需要能处理不完整代码(2) 现有方法局限性(3) 验证局限性: 初步实验研究实验设计何为不完整代码实验结果…

【Vite】项目中scss 保存后 文件编译成了wxss,已解决

文章目录 前言一、在 vscode 中安装 easy sass 扩展二、在微信开发者工具导入 vscode 安装的 easy sass 扩展三、修改 easy sass 配置 前言 最近学习使用vite,在vite中使用sass 的时候每次保存都把scss文件编译成wxss文件。众所周知&#xff0c;wxss文件是微信小程序的样式。当…

开放式蓝牙耳机推荐性价比?开放式耳机性价比排行榜!

耳机在日常生活中几乎成了大多数人的必备伴侣&#xff0c;无论是听音乐、玩游戏还是追剧&#xff0c;都扮演着不可或缺的角色。但是&#xff0c;面对市场上众多的耳机品牌和款式&#xff0c;要找到一款真正符合个人需求的产品并不容易。尤其是考虑到传统入耳式耳机可能在长时间…

PN8035非隔离12V450mA开关电源芯片SOP8/DIP8封装

PN8035 高性能非隔离交直流转换芯片 PN8035SEC-R1 SOP8 12V 0.45A PN8035NE-A1 DIP8 12V 0.45A PN8035集成PFM控制器及650V高雪崩能力智能功率MOSFET&#xff0c;用于外围元器件极精简的小功率非隔离开关电源。PN8035内置高压启动模块&#xff0c;实现系统快速启动、…